Skip to content

train problem #49

@cyanymore

Description

@cyanymore

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions