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?
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.