import logging
logging.getLoger("tensorflow").setLevel(logging.DEBUG)
import pathlib
converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()
tflite_model_dir=pathlib.Path("/tmp/mnist_tflite_models/")
tflite_models_dir.mkdir(exist_ok=True, parents=True)
tflite_model_file = tflite_models_dir/"mnist_model.tflite"
tflite_model_file.write_bytes(tflite_model)
import importlib
import argparse
from threading import Thread
from absl import app, flags, logging
from absl.flags import FLAGS