anger-man / unsupervised-image-transfer-and-uq

3 stars 1 forks source link

Cannot run train #1

Open ErisGe opened 1 year ago

ErisGe commented 1 year ago

I used the command python train_uapi.py --direc 'ixi/' to run train_uapi.py, but one mistake happened.

File "/home/hg/anaconda3/envs/SHD/lib/python3.8/site-packages/tensorflow/python/autograph/impl/api.py", line 692, in wrapper raise e.ag_error_metadata.to_exception(e) ValueError: Exception encountered when calling layer "gradient_penalty" (type GradientPenalty).

in user code:

File "/home/hg/unsupervised-image-transfer-and-uq-master/functions.py", line 66, in call  *
    norm_grad = K.sqrt(K.sum(K.square(gradients), axis=[1,2,3]))
File "/home/hg/anaconda3/envs/SHD/lib/python3.8/site-packages/keras/backend.py", line 2750, in square
    return tf.square(x)

ValueError: Tried to convert 'x' to a tensor and failed. Error: None values not supported.

Call arguments received: • inputs=['tf.Tensor(shape=(None, 5, 5, 1), dtype=float32)', 'tf.Tensor(shape=(None, 128, 128, 1), dtype=float32)']

anger-man commented 1 year ago

Hi ErisGe Unfortunately I was not able to reproduce this error. It seems that there have been a problem with the images in your case. Following things could rise this error:

Best, Christoph

ErisGe commented 1 year ago

Thanks! I will check these points.