Created
March 16, 2018 02:45
-
-
Save haoxi911/1885bf436ca24087627a4cd2018141f5 to your computer and use it in GitHub Desktop.
Convert Mobilenet_v1 weights from TensorFlow to CoreML format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import tfcoreml as tf_converter | |
tf_model_path = os.path.join(os.getcwd(), 'output_graph.pb') | |
mlmodel_path = os.path.join(os.getcwd(), 'output_graph.mlmodel') | |
mlmodel = tf_converter.convert( | |
tf_model_path = tf_model_path, | |
mlmodel_path = mlmodel_path, | |
output_feature_names = ['final_result:0'], | |
input_name_shape_dict = {'input:0':[1,224,224,3]}, | |
image_input_names = ['input:0'], | |
red_bias = -1, | |
green_bias = -1, | |
blue_bias = -1, | |
image_scale = 2.0/255.0) |
Author
haoxi911
commented
Mar 16, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment