自定义数据集中的错误
你好,我已经成功使用自定义数据集进行训练,数据集的结构如下: A - 图像 B - 分割图 C - 实例图 A 含有图像,B 含有分割图,C 含有实例图。 现在我正在尝试进行预测。我尝试按照您主页上的说明进行操作: `Python test.py --name [name_of_experiment] --dataset_mode [dataset_mode] --dataroot [path_to_dataset]` 但我收到了以下错误: `test.py: error: the following arguments are required: --label_dir, --image_dir` 因此我指定了脚本所要求的参数。但我收到了以下错误: 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]). ...
内容来源: NVlabs/SPADE