You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I managed to train with my custom dataset, organised as follows:
A
|-train
|-val
|-test
B
|-train
|-val
|-test
C
|-train
|-val
|-test
With A containing the images, B containing segmentation maps, and C containing instance maps.
Now I am trying to predict. I tried using the instructions from your main github page: python test.py --name [name_of_experiment] --dataset_mode [dataset_mode] --dataroot [path_to_dataset]
But I get the error: test.py: error: the following arguments are required: --label_dir, --image_dir
So I specified the arguments the script was asking for. But I get the error:
Traceback (most recent call last):
File "test.py", line 19, in <module>
model = Pix2PixModel(opt)
File "/net/serpico-fs2/emoebel/increased/semantic_img_synthesis/SPADE/models/pix2pix_model.py", line 25, in __init__
self.netG, self.netD, self.netE = self.initialize_networks(opt)
File "/net/serpico-fs2/emoebel/increased/semantic_img_synthesis/SPADE/models/pix2pix_model.py", line 96, in initialize_networks
netG = util.load_network(netG, 'G', opt.which_epoch, opt)
File "/net/serpico-fs2/emoebel/increased/semantic_img_synthesis/SPADE/util/util.py", line 208, in load_network
net.load_state_dict(weights)
File "/net/serpico-fs2/emoebel/venv/spade/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1483, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for SPADEGenerator:
size mismatch for fc.weight: copying a param with shape torch.Size([1024, 3, 3, 3]) from checkpoint, the shape in current model is torch.Size([1024, 14, 3, 3]).
size mismatch for head_0.norm_0.mlp_shared.0.weight: copying a param with shape torch.Size([128, 3, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 14, 3, 3]).
...
Dear developers, could you please make a tutorial on how to use your code with a custom dataset? (and please test it yourself to make sure it works). It would be nice that this tutorial includes how to organise the data folder. This would be very helpful for everybody. I am sure I am not the only one who wants to test your code with custom data.
The text was updated successfully, but these errors were encountered:
Okay so I managed to make it work... I had to randomly test different options python test.py --name canalB --dataset_mode custom --label_dir datasets/increased/canalB/B/test --image_dir datasets/increased/canalB/A/test --label_nc 3 --no_instance
What is strange, is that for training I used --label_nc 2 but for test I have to put --label_nc 3 else I get an error size mismatch for fc.weight
Another useful information would be: how can I get predictions that have the size and resolution of the original input image? The test procedure outputs images of size 256x256. But I would like the image to have the original size which is 1008x888
Hello, I managed to train with my custom dataset, organised as follows:
With A containing the images, B containing segmentation maps, and C containing instance maps.
Now I am trying to predict. I tried using the instructions from your main github page:
python test.py --name [name_of_experiment] --dataset_mode [dataset_mode] --dataroot [path_to_dataset]
But I get the error:
test.py: error: the following arguments are required: --label_dir, --image_dir
So I specified the arguments the script was asking for. But I get the error:
Dear developers, could you please make a tutorial on how to use your code with a custom dataset? (and please test it yourself to make sure it works). It would be nice that this tutorial includes how to organise the data folder. This would be very helpful for everybody. I am sure I am not the only one who wants to test your code with custom data.
The text was updated successfully, but these errors were encountered: