I want to use the full codes from
https://becominghuman.ai/building-an-image-classifier-using-deep-learning-in-python-totally-from-a-beginners-perspective-be8dbaf22dd8
regarding image identifiers. However there is problem with the KERAS. everytime I run
from keras.models import Sequential
from keras.layers import Conv2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
it gives this:
%run -i "/var/folders/23/fqcfyh1n5992xf4k9w0f40th0000gn/T/tmpP_8Umu.py"
ImportError Traceback (most recent
call last)
/var/folders/23/fqcfyh1n5992xf4k9w0f40th0000gn/T/tmpP_8Umu.py in .
<module>()
1 from keras.models import Sequential
2 from keras.layers import Conv2D
3 from keras.layers import MaxPooling2D
4 from keras.layers import Flatten
5 from keras.layers import Dense
ImportError: No module named 'keras.models'
I tried to re-install KERAS, but it doesn't work
sudo pip install git+git://github.com/fchollet/keras.git --upgrade
The previous codes seems to re-download and re-install KERAS, but still keras.models and keras.layers cannot be loaded and founded.
You are using an old version of Keras, from fchollet's old repository, the modern repository is https://github.com/keras-team/keras/
You should install keras using pip directly without github, like:
pip install --user keras
This will install the latest version in your use folder. Try to avoid using pip with sudo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With