junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch
Other
23.14k stars 6.32k forks source link

cycleGan_pix2pix direction (?) issue #1256

Open iWolph opened 3 years ago

iWolph commented 3 years ago

Helo, I'm a rookie starting to work with cycleGAN_pix2pix. In that sense, I appreciate suggestions on this issue.
I'm getting the following error while testing the pix2pix model that i trained for my dataset, such as:

Command: !python test.py --dataroot "/content/drive/MyDrive/REST SPECT" --name speckle_shapes --model pix2pix --netG unet_256 --direction AtoB --dataset_mode single --norm batch --checkpoints_dir /content/drive/MyDrive/speckle_shapes --results_dir /content/drive/MyDrive/speckle_shapes/speckle_shapes --input_nc 1 --output_nc 1

Error: Traceback (most recent call last): File "test.py", line 62, in model.set_input(data) # unpack data from data loader File "/content/pytorch-CycleGAN-and-pix2pix/models/pix2pix_model.py", line 83, in set_input self.real_B = input['B' if AtoB else 'A'].to(self.device) KeyError: 'B'

Thank you in advance.

iWolph commented 3 years ago

Update: When I Run "model test" dataset single mode, works fine. But this is the correct aproach, since i've trained with the pix2pix model (dataset mode aligned) and now I'm testing it with "model test" (single mode)? Thank you so much.