Keras: How can i downgrade keras from 2.2.4 ?

Created on 17 Jan 2019  路  3Comments  路  Source: keras-team/keras

With Tensorflow version 1.3 and Keras 2.2.4, i'm receiving error while creating sequential model

TypeError: softmax() got an unexpected keyword argument 'axis'

Help me to resolve this.

One such resolution i can across is to downgrade keras to lower version as new version doesn't support axis argument in softmax(). What are the steps i need to perform to download it

Most helpful comment

You can try pip install keras==[version number] to install a specific version of keras from pypi .
I browser github repo of tensorflow and notice that the date when the tensorflow 1.3 released is Aug 17, 2017. So i think you can install keras 2.1.2 which released on Dec 2, 2017 by github repo. The date is just a few months later than that of tensorflow. I don't verify this but i think it may work well.

TLDR, try this:

  1. pip uninstall keras

  2. pip install keras==2.1.2

If you need the document of keras 2.1.2, you can open this link and follow the instructions there.

I check the code and find that keras the version of which is before 2.0.2 will raise this error.
You can check the code file1 and file2 for detail. So, you need to upgrade keras instead of to downgrade.

All 3 comments

You can try pip install keras==[version number] to install a specific version of keras from pypi .
I browser github repo of tensorflow and notice that the date when the tensorflow 1.3 released is Aug 17, 2017. So i think you can install keras 2.1.2 which released on Dec 2, 2017 by github repo. The date is just a few months later than that of tensorflow. I don't verify this but i think it may work well.

TLDR, try this:

  1. pip uninstall keras

  2. pip install keras==2.1.2

If you need the document of keras 2.1.2, you can open this link and follow the instructions there.

I check the code and find that keras the version of which is before 2.0.2 will raise this error.
You can check the code file1 and file2 for detail. So, you need to upgrade keras instead of to downgrade.

Upgrading and downgrading python packages is unrelated to keras. This is more a question for stackoverflow.
In your case, I would update tensorflow, it's very likely what causes the issue.

Type the following command in colab will downgrade TensorFlow to version 1.15 and tf.keras to 2.2

%tensorflow_version 1.x

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LuCeHe picture LuCeHe  路  3Comments

anjishnu picture anjishnu  路  3Comments

farizrahman4u picture farizrahman4u  路  3Comments

amityaffliction picture amityaffliction  路  3Comments

nryant picture nryant  路  3Comments