How about using TensorFlow for your development and just using any of the CoreML converters (coremltools) for converting that tensorflow/keras models (.h5, Savedmodel, tf.keras.Model) into Xcode supported .mlmodel formats ?
Post
Replies
Boosts
Views
Activity
As mentioned in the official Apple docs,
OS Requirements : macOS 12.0+
You can watch more in the WWDC 2021 session here : https://developer.apple.com/videos/play/wwdc2021/10152/
python -m pip install tensorflow-macos will run Python 2 and ask it to install tensorflow which is why you're getting the error that there is no such distribution. You should change the command instead to python3 -m pip install tensorflow-macos and it will work.
If it doesn't that means there is no python 3 in your system (which you can get from Anaconda or just brew install python3 )
For more instructions on Tensorflow installation, you should follow this link : https://www.tensorflow.org/install/pip#macos
People, please go through the tensorflow-metal requirements here : https://developer.apple.com/metal/tensorflow-plugin/
It clearly mentions that the requirements for macOS are 12.0 (Monterey). There is no point in trying it out on Big Sur as it will run in a very unoptimised CPU settings.
Tensorflow-Metal was built using MPSGraph inference enhancements capabilities and thus, was only meant to be used with GPUs. You can watch more in the WWDC 2021 session here : https://developer.apple.com/videos/play/wwdc2021/10152/
Were you able to solve this ?
My suggestion is for you to go through this link : https://developer.apple.com/metal/tensorflow-plugin/ and understand the instructions written under each command. It clearly mentions for x86 (intel) based Macs that "Python 3.8 is required" and for arm64 Apple Silicon Macs, "both Python 3.8 and 3.9 are supported".
So, please, try using Python 3.8 by creating a new environment and see if you get the same error again or not.
Also, I've noticed that you're accessing the console via some sort of IDE (maybe VSCode?) but can I ask you try it out using an actual terminal application ? Sometimes, the interpreters get really screwed up when using Python consoles inside of IDEs.
Lastly, if none of this worked, it means that the h5py~=3.1.0 is a dependency conflict (even though I can see 3.1.0 is available from pip). This should be fixed by the developers that provide the installation instructions and so, you should open up an issue in the TensorFlow repository
But, before opening an issue, please make sure you can try everything correctly and troubleshoot as much as possible from your end.