Reputation: 109
I am a beginner in Keras. I installed Anaconda with Python 3.6, then installed Tensorflow and ran some models I found on the Internet. Then I just found out about Keras which is just what I need to learn about Neural Networks. I installed Keras and it didn't have any errors. Then I found a short simple XOR model using Keras but it just didn't work and complained that it doesn't know what Keras is?? I hope someone may be able to help.
Upvotes: 9
Views: 40441
Reputation: 11144
I had the same problem after changing the default python running on the linux to python 3 I had to change the first line of the executable python file environment:
from:
#!/usr/bin/env python
to:
#!/usr/bin/env python3
pretty simple "by one" error i guess
Upvotes: 0
Reputation: 559
Because keras is under tensorflow, instead of:
from keras.models import Sequential
...try:
from tensorflow.keras.models import Sequential
Upvotes: 6
Reputation: 56407
The problem is that you have a file named "keras.py" and this shadows the real keras package. Don't do that, never name a python script the same as a package.
Solution is to rename your keras.py script into a different name.
Upvotes: 28