Skip to content

cyclicGAN issues and solutions #18

@idhamari

Description

@idhamari

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)
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions