zhenchengfang / PPR-Meta

A tool for identifying phages and plasmids from metagenomic fragments using deep learning
GNU Lesser General Public License v3.0
42 stars 9 forks source link

ImportError: No module named keras.models #1

Open Handymanalan opened 5 years ago

Handymanalan commented 5 years ago

Hi,

I have installed all dependencies through python pip install, but I still got this error:

ImportError: No module named keras.models

I have Keras==2.2.4 installed. Is it due to the script indicate keras but not Keras? If so, how could I change the script?

Cheers

Alan

zhenchengfang commented 5 years ago

Hi,

Thank you for your interest in PPR-Meta. I think this problem may be caused by the version of the keras. PPR-Meta is trained using version 2.0.8. In my experience, the different versions of keras or tensorflow are sometimes incompatible. I think you can execute the command “import keras” and “from keras.models import Sequential” in python interface, respectively. If there is no error when executing “import keras”, the keras package has been installed successfully and this problem is likely caused by the keras verion. You can also choose to run PPR-Meta in the virtual machine following the video guide, this will be much easier.

Handymanalan commented 5 years ago

Thanks.

Strange that when I check with pip freeze, I got Keras==2.2.4 in the HPC. But upon the command line "import keras" in the python interface, I got this error: ImportError: No module name keras

I will use the virtual machine. I will see if I can install it in my institute's HPC.

Cheers

Alan

zhenchengfang commented 5 years ago

If there is an error when executing “import keras”, the keras package may have not been installed successfully. I think this may be the PATH issue or you can consider install keras and tensorflow using Anaconda. Of course, using virtual machine is a good choice.