My SGD optimizer works well if I use the default parameters but I had an error when I try to modify the parameters. Could you please help me to fix it? Is it my code or my Keras installation?
from tensorflow.python.keras.models import Sequential
from tensorflow.python.keras.layers import Dense, Flatten, GlobalAveragePooling2D, Activation
import keras
from keras.optimizers import SGD
model = Sequential()
model.add(Dense(64, kernel_initializer='uniform', input_shape=(10,)))
model.add(Activation('softmax'))
model.compile(loss='mean_squared_error', optimizer=SGD(lr=0.01), metrics=['accuracy'])
Traceback (most recent call last):
File "C:\TensorFlow\Keras\ResNet-50\test_sgd.py", line 10, in <module>
model.compile(loss='mean_squared_error', optimizer=SGD(lr=0.01), metrics=['accuracy'])
File "C:\Users\nsugiant\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\keras\_impl\keras\models.py", line 787, in compile
**kwargs)
File "C:\Users\nsugiant\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\keras\_impl\keras\engine\training.py", line 632, in compile
self.optimizer = optimizers.get(optimizer)
File "C:\Users\nsugiant\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\keras\_impl\keras\optimizers.py", line 788, in get
raise ValueError('Could not interpret optimizer identifier:', identifier)
ValueError: ('Could not interpret optimizer identifier:', <keras.optimizers.SGD object at 0x000002039B152FD0>)