Cannot import name 'SGD' from 'keras.optimizers' when importing talos

3.4k Views Asked by At

I am trying to import talos python module using import talos this is the error I get:

ImportError: cannot import name 'SGD' from 'keras.optimizers'

I have solved the same error message before when I used from keras.optimizers import Adam,Nadam, SGD changing the code to from tensorflow.keras.optimizers import Adam,Nadam, SGD. However, the error message I get now is within the internal talos import command. talos 0.4.8, keras 2.2.4, tensorflow 2.6.0 Thank you

1

There are 1 best solutions below

0
On

Talos 0.4.8 supports Tensorflow 2.0.0

Install latest version of Talos==1.0, which supports Tensorflow 2.6.0.

from tensorflow.keras.optimizers import Adam,Nadam, SGD and import talos works just fine with talos 1.0 and Tensorflow 2.6.0.