Cannot install Tensorflow_hub on macbook air M1 Monterey 12.2.1

Hi I am facing issue with installing tensorflow_hub on MacBook Air 2020 M1 Monterey 12.2.1. I have installed miniforge conda tensorflow as per instructions on apple help site.

https://developer.apple.com/metal/tensorflow-plugin/

Tensorflow works, but tensorflow_hub fails during installation. It cannot find the packages. There is no help information available on tensorflow or conda website. Can anyone please suggest possible way to fix this. During installation conda gives a long list of package conflicts (python, etc) and does not install.

% conda install -c conda-forge tensorflow-hub

Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: / Found conflicts! Looking for incompatible packages. This can take several minutes. Press CTRL-C to abort. failed

UnsatisfiableError: The following specifications were found to be incompatible with the existing python installation in your environment:

I ran in to the same problem this weekend.

The only way to solve it is to create a new and fresh conda environment and go through these steps;

https://developer.apple.com/metal/tensorflow-plugin/

I was able to install both TF-Hub along with PT and PT Lightning with GPU support in the new environment.

I've also noticed that the 2.5 version of TF works best, so try 'conda install -c apple tensorflow-deps==2.5.0' first.

Hope it will work out for you!

Hi @datawisdomx

You should be able to do simply python -m pip install tensorflow-hub while in the new conda environment you've created following the guide. It seems to function as expected for me locally. Let us know if this works for you!

Cannot install Tensorflow_hub on macbook air M1 Monterey 12.2.1
 
 
Q