Some issues I faced and some suggested solutions: 1. ImportError: cannot import name 'InstanceNormalization' #from keras_contrib.layers.normalization import InstanceNormalization, InputSpec from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization from keras_contrib.layers.normalization import InputSpec 2. ImportError: cannot import name 'Container' #from keras.engine.topology import Container from keras.engine.network import Network 3. ImportError: cannot import name 'imsave' pip install pillow from PIL import Image #toimage(image, cmin=-1, cmax=1).save(path_name) Image.fromarray(image.astype(np.uint8)).save(path_name) 4. AttributeError: module 'tensorflow' has no attribute 'squared_difference' #loss = tf.reduce_mean(tf.squared_difference(y_pred, y_true)) loss = tf.reduce_mean(tf.math.squared_difference(y_pred, y_true)) 5. AttributeError: module 'tensorflow' has no attribute 'ConfigProto', #config = tf.ConfigProto() config = tf.compat.v1.ConfigProto() 6. AttributeError: module 'tensorflow' has no attribute 'Session' #K.tensorflow_backend.set_session(tf.Session(config=config)) tf.compat.v1.keras.backend.get_session(config)
Some issues I faced and some suggested solutions:
ImportError: cannot import name 'InstanceNormalization'
ImportError: cannot import name 'Container'
ImportError: cannot import name 'imsave'
AttributeError: module 'tensorflow' has no attribute 'squared_difference'
AttributeError: module 'tensorflow' has no attribute 'ConfigProto',
AttributeError: module 'tensorflow' has no attribute 'Session'