Skip to content
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

train problem #49

Open
cyanymore opened this issue Oct 9, 2023 · 0 comments
Open

train problem #49

cyanymore opened this issue Oct 9, 2023 · 0 comments

Comments

@cyanymore
Copy link

Traceback (most recent call last):
File "train.py", line 58, in
trainer.run_discriminator_one_step(data_i)
File "C:\Users\64883\Desktop\ref_code\CoCosNet-master\trainers\pix2pix_trainer.py", line 70, in run_discriminator_one_step
d_losses = self.pix2pix_model(data, mode='discriminator', GforD=GforD)
File "D:\Anaconda3\envs\paddlepaddle\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\64883\Desktop\ref_code\CoCosNet-master\models\pix2pix_model.py", line 52, in forward
input_label, input_semantics, real_image, self_ref, ref_image, ref_label, ref_semantics = self.preprocess_input(data, )
File "C:\Users\64883\Desktop\ref_code\CoCosNet-master\models\pix2pix_model.py", line 193, in preprocess_input
input_semantics[:,-3:-2,:,:] = glasses
RuntimeError: The expanded size of the tensor (1) must match the existing size (0) at non-singleton dimension 1. Target sizes: [1, 1, 256, 256]. Tensor sizes: [0, 256, 256]

the problem is solved by setting the self.preprocess_input(data, ) to self.preprocess_input(data.copy(), ) in line 52 of pix2pix_model.py.

thanks to #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant