microsoft / MMdnn

MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.
MIT License
5.8k stars 965 forks source link

Keras module not found (and some others too) #824

Open bwery opened 4 years ago

bwery commented 4 years ago

Platform (like ubuntu 16.04/win10): ubuntu 18.04

Python version: 3.6.9

After installation of mmdnn with command "pip install mmdnn", any mmdnn command related to keras fails with message: "ModuleNotFoundError: No module named 'keras'"

For instance command "$mmdownload -f keras" produces this error stack:

Traceback (most recent call last): File "/home/bw/.local/bin/mmdownload", line 8, in sys.exit(_main()) File "/home/bw/.local/lib/python3.6/site-packages/mmdnn/conversion/_script/extractModel.py", line 122, in _main extract_model(args) File "/home/bw/.local/lib/python3.6/site-packages/mmdnn/conversion/_script/extractModel.py", line 30, in extract_model from mmdnn.conversion.examples.keras.extractor import keras_extractor File "/home/bw/.local/lib/python3.6/site-packages/mmdnn/conversion/examples/keras/extractor.py", line 8, in import keras ModuleNotFoundError: No module named 'keras'

This does not to occur with "caffe" or "mxnet" for which such command succeeds, but it occurs also with the other framework identifiers.

May be an installation issue ?

Thank you for your help !

linmajia commented 4 years ago

@bwery , thank you very much for the feedback. MMdnn does not install Keras automatically, so you may try the following command to install it manually:

pip3 install --user keras==2.2.4

Please note:

  1. '--user' will install Keras to /home/bw/.local/lib/python3.6/site-packages
  2. You may try the latest Keras 2.3.1
bwery commented 4 years ago

Thank you linmajia ! Seems to be the first step for resolution. It was not clear for me that mmdnn was requiring the frameworks to be present. This solve the issue about the module not found. Now, I have another issue that looks related to the fact that I have Tensoflow 2.1 installed, but this is another point. I investigate.

AlexPasqua commented 4 years ago

@bwery , thank you very much for the feedback. MMdnn does not install Keras automatically, so you may try the following command to install it manually:

pip3 install --user keras==2.2.4

Please note:

  1. '--user' will install Keras to /home/bw/.local/lib/python3.6/site-packages
  2. You may try the latest Keras 2.3.1

I have Keras installed, but still I get the same error.

Platform: Ubuntu 18.04 Python version: 3.6.9 Keras version: 2.3.1