UPstartDeveloper / tensorflowtools

Tools for converting to Tensorflow saved models from other save formats.
0 stars 0 forks source link

Convert from CoreML to Tensorflow #2

Open UPstartDeveloper opened 2 years ago

UPstartDeveloper commented 2 years ago

My hunch on how to do this (credit to Matthijs Hollemans for inspiring this idea in this Stack Overflow answer):

  1. Use coremltools to load in an .mlmodel, and use the Core ML specification to output a JSON defining the layers of the neural network architecture.
  2. Refine the model in TensorFlow (hopefully using that JSON to convert to the equivalent layers defined in tf.keras
  3. Then copy the weights from the Core ML model into the TF model (again, using coremltools).
UPstartDeveloper commented 2 years ago

Big question for step 3: how exactly do we read the weights from an .mlmodel using coremltools?