The TensorFlow team has developed a package that is used to convert the models created in TensorFlow into Core ML, which in through is used in iOS apps. To use this, you must have macOS with Python 3.6 and TensorFlow installed. Using this, we can convert the TensorFlow model file (.pb) into the Core ML format (.mlmodel). First, you need to execute the following command:
Pip install tfcoreml
Once this is installed, write the following code in your Python file, name it inspect.py, and save it:
import tensorflow as tffrom tensorflow.core.framework import graph_pb2import timeimport operatorimport sys def inspect(model_pb, output_txt_file): graph_def = graph_pb2.GraphDef() with open(model_pb, ...