“Could not interpret optimizer identifier” error in Keras

后端 未结 14 1438
别跟我提以往
别跟我提以往 2021-02-03 19:47

I got this error when I tried to modify the learning rate parameter of SGD optimizer in Keras. Did I miss something in my codes or my Keras was not installed properly?

相关标签:
14条回答
  • 2021-02-03 20:12

    I recently faced similar problem.

    The reason is you are using tensorflow.python.keras api for model and layers and keras.optimizers for SGD. They are two different keras versions of tensorflow and pure keras. They could not work together. You have to change everything to one version. Then it should work. :)

    Hope this helps.

    0 讨论(0)
  • 2021-02-03 20:19

    I got the same error message and resolved this issue, in my case, by replacing the assignment of optimizer:

    optimizer=keras.optimizers.Adam
    

    with its instance instead of the class itself:

    optimizer=keras.optimizers.Adam()
    
    0 讨论(0)
提交回复
热议问题