umap
umap copied to clipboard
Module Keras/tensorflow_probability not found when importing Parametric UMAP
When I want to import the Parametric UMAO (from umap.parametric_umap import ParametricUMAP
) I get the following error:
C:\tools\miniconda3\lib\site-packages\umap\parametric_umap.py:45: UserWarning: Global structure
preservation in the umap.parametric_umap package requires
tensorflow_probability to be installed. You can install tensorflow_probability at
https://www.tensorflow.org/probability,
or via
pip install --upgrade tensorflow-probability
Please ensure to install a version which is compatible to your tensorflow
installation. You can verify the correct release at
https://github.com/tensorflow/probability/releases.
warn(
...
ModuleNotFoundError: No module named 'keras'
But I have keras 2.6.0, tensorflow 2.6.0 and tensorflow_probability 0.14 installed. (Python 3.9.7 on Win 10 Pro)
I had the same issue using a conda environment (keras 2.6.0, tensorflow 2.6.0 and tensorflow_probability 0.15. Python 3.8.6) and fixed it by relying only on pip packages.
It was due to some sort of clash between pip and conda. It's generally advised not to mix packages from both sources, yet I somehow still did. The fix was to reinstall tensorflow and all related packages using pip.
I then subsequently got an AlreadyExistsError: Another metric with the same name already exists
, which I fixed by pip uninstall keras
(since 2.8.0 was automatically installed) then pip install keras==2.6.0
.