Open ricmarlene opened 3 years ago
I'm not sure what's going on here. Are you using the most recent version of TuriCreate? What version of coremltools is installed in your environment?
Can you share your model? i.e can you call model.save(<path>)
and share that file?
Thank you for your response!
For more information, I tried to update my coremltools to 4.1 after I post this issue and it doesn't work as well.
Using your model I'm able to run model.export_coreml('myclassifier4.mlmodel')
just fine. My version of TuriCreate and coremltools is the same.
What OS are you using? Does this happen every time you try to run model.export_coreml('myclassifier4.mlmodel')
?
Sorry for the late reply. I tested the same code many times last week (in different anaconda environment). Weird thing happened that the same code run just fine yesterday. It seems to be a problem with the pre-trained resnet-50 model downloading process when calling model = tc.load_model('garbage_v4')
. After days my computer clean the cached pre-trained resnet-50 model and it downloads again.
Decode Error
happened every time before. Now code runs well except two warning:
WARNING:root:TensorFlow version 2.5.0 detected. Last version known to be fully compatible is 2.2.0 .
WARNING:root:Keras version 2.5.0 detected. Last version known to be fully compatible of Keras is 2.2.4 .
I'd like to know if I occur the same problem next time, what should I do to fix it? Thank you for the discuss!
Those two warnings are from coremltools not TuriCreate. They aren't relevant for this issue and can be ignored here.
I suspect the pretrained ResNet-50 model was not downloaded correctly. If you have this issue in the future, I would recommend clearing the Turi file cache. To do that get the following value:
tc.config.get_runtime_config()['TURI_CACHE_FILE_LOCATIONS']
Then delete everything underneath it or at least the ResNet files.
Thank you for your response. It helps me a lot! I guess the model wasn’t downloaded correctly because of the network connection with GitHub in China. Maybe I didn't set up the proxy correctly, which resulted in a poor network status.
I can't export .mlmodel while it's possible to use save() to save model file.
Here's the code and Error message: