0

I have successfully installed keras after much struggle in the directory /usr/local/lib/python3.5/dist-packages(by deafult it has been installed there). But whenever i am trying to import or trying to modify the keras backend it says No mudule named keras. What am I doing wrong here and how will I modify the keras.json file in these current conditions?

enter image description here

Alapan Bag
  • 255
  • 2
  • 3
  • 15

2 Answers2

0

you should be able to edit keras.json directly. it should be at ~/.keras/keras.json .

also it seems you installed keras for python3 but are trying to use it with python(2). try using pip instead of pip3 (or python3 instead of python). :) see details here.

Community
  • 1
  • 1
teknoboy
  • 175
  • 1
  • 2
  • 12
0

What am I doing wrong here?

The problem is that you start Python 2, but you installed it for Python 3. Your system has likely both Python versions, but you installed it only for one.

If you want to start Python 3, try python3:

python3 -c "from keras import backend; print(backend._BACKEND)"

How do I modify the keras.json file?

Open ~/.keras/keras.json with the editor of your choice. For example:

nano ~/.keras/keras.json
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958