Keras program with error
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.
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.
Because keras is under tensorflow, instead of:
from keras.models import Sequential
...try:
from tensorflow.keras.models import Sequential
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