-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can you help me to solve this error,thank you!!!! #2
Comments
It's hard to say what is the problem. |
I've added this sentence. from keras import backend as K K.set_image_dim_ordering('th') , when I run train.py. |
Hi, After adding the sentence K.set_image_dim_ordering('th'), I solved that error by changing line 231 in the models.py file. This way, batch_size = K.shape(z_mean)[0] However, I am getting another error, not sure why. **Exception in thread Thread-2: Exception KeyError: KeyError(<weakref at 0x7f3ff4fa7f70; to 'tqdm' at 0x7f3ff4d53710>,) in <bound method tqdm.del of 0%| | 0/100 [00:00<?, ?it/s]> ignored I think is something related to the g_unet architecture. But I am not sure :( |
I proposed a solution for these issues. Please check the Pull request @costapt @jiahaoMeng |
@diazandr3s Traceback (most recent call last): File "", line 1, in File "/home/meng/.conda/envs/python27/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile File "/home/meng/.conda/envs/python27/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile File "/media/meng/My Passport/adversarial_retinal_synthesis-master/train.py", line 474, in File "/media/meng/My Passport/adversarial_retinal_synthesis-master/train.py", line 351, in train File "/media/meng/My Passport/adversarial_retinal_synthesis-master/train.py", line 283, in train_iteration File "/media/meng/My Passport/adversarial_retinal_synthesis-master/train.py", line 106, in train_discriminator File "/home/meng/.conda/envs/python27/lib/python2.7/site-packages/Keras-1.2.2-py2.7.egg/keras/engine/training.py", line 1532, in fit_generator ValueError: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None |
@jiahaoMeng |
@diazandr3s |
@diazandr3s And the pictures I trained are not very good. I don't know what the problem is. |
Hi @jiahaoMeng Regarding the image quality, @costapt could tell us more. |
Thank you for your help @diazandr3s ! I am not sure what might be the issue with the test script. By reading the error message it seems like params.results_dir and/or params.expt_name might be incorrectly set. Can you confirm their values? About the results quality, it usually takes a long time to fully train the model, it may be the case that it still did not converge. Can you send the train and val losses? |
@costapt Thank you for your help! |
It looks like the model still needs more training, you can see that the Pix2Pix loss was starting to decrease. I remember that I have seen images like those during training, so I believe that the images will get sharper with more time. |
@jiahaoMeng I recently reproduced the code of this paper and found that the problems I encountered were the same as yours。How does the code of your experiment work in the end? Did you modify the code?Thank you very much for your reply. |
runfile('/media/meng/C disk/mjh/gan/end to end /code/adversarial_retinal_synthesis-master/train.py', wdir='/media/meng/C disk/mjh/gan/end to end /code/adversarial_retinal_synthesis-master')
Reloaded modules: models, util, util.data, util.util
Traceback (most recent call last):
File "", line 1, in
runfile('/media/meng/C disk/mjh/gan/end to end /code/adversarial_retinal_synthesis-master/train.py', wdir='/media/meng/C disk/mjh/gan/end to end /code/adversarial_retinal_synthesis-master')
File "/home/meng/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 710, in runfile
execfile(filename, namespace)
File "/home/meng/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 101, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/media/meng/C disk/mjh/gan/end to end /code/adversarial_retinal_synthesis-master/train.py", line 422, in
is_binary=params.is_a_binary)
File "/media/meng/C disk/mjh/gan/end to end /code/adversarial_retinal_synthesis-master/models.py", line 235, in g_vae
z = Lambda(sampling, output_shape=(latent_dim,))([z_mean, z_log_var])
File "/home/meng/anaconda3/lib/python3.6/site-packages/Keras-1.2.2-py3.6.egg/keras/engine/topology.py", line 572, in call
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/home/meng/anaconda3/lib/python3.6/site-packages/Keras-1.2.2-py3.6.egg/keras/engine/topology.py", line 635, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/home/meng/anaconda3/lib/python3.6/site-packages/Keras-1.2.2-py3.6.egg/keras/engine/topology.py", line 172, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors, mask=input_masks))
File "/home/meng/anaconda3/lib/python3.6/site-packages/Keras-1.2.2-py3.6.egg/keras/layers/core.py", line 641, in call
return self.function(x, **arguments)
File "/media/meng/C disk/mjh/gan/end to end /code/adversarial_retinal_synthesis-master/models.py", line 232, in sampling
mean=0., std=1.)
File "/home/meng/anaconda3/lib/python3.6/site-packages/Keras-1.2.2-py3.6.egg/keras/backend/tensorflow_backend.py", line 2935, in random_normal
dtype=dtype, seed=seed)
File "/home/meng/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/random_ops.py", line 71, in random_normal
shape_tensor = _ShapeTensor(shape)
File "/home/meng/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/random_ops.py", line 42, in _ShapeTensor
return ops.convert_to_tensor(shape, dtype=dtype, name="shape")
File "/home/meng/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 836, in convert_to_tensor
as_ref=False)
File "/home/meng/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 926, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/meng/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 229, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/home/meng/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 208, in constant
value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/home/meng/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 472, in make_tensor_proto
"supported type." % (type(values), values))
TypeError: Failed to convert object of type <class 'tuple'> to Tensor. Contents: (Dimension(None), 16). Consider casting elements to a supported type.
The text was updated successfully, but these errors were encountered: