Could anyone please tell where could be the error. I updated the json to coco format. So I am pretty sure, that there isn't any error wrt json file. All images are of size (256,192,3). I don't understand why it is showing size as [1,256,192,3]. I have rechecked the sizes of all images, it works fine if it's just their inference data, but fails with my dataset.
First 4 examples in demo.txt are the inference samples, and the last is my custom sample.
1LJ21D005-G11@10=person_half_front.jpg AD121D0G7-A11@10=person_half_front_keypoints.json CO121D08G-O11@10=cloth_front.jpg test
1VJ21D02K-Q11@8=person_half_front.jpg AD121D0F0-G12@10=person_half_front_keypoints.json AD121D0HY-Q11@18=cloth_front.jpg test
4HI21D003-C11@10=person_half_front.jpg EV421EA51-A11@9=person_whole_front_keypoints.json [email protected]=cloth_front.jpg test
A0F21D012-K11@8=person_half_front.jpg EV421DAIY-E11@8=person_half_front_keypoints.json [email protected]=cloth_front.jpg test
10resized.jpg 10resized_keypoints.json s-1resized.jpg test
Running forward
+ CUDA_VISIBLE_DEVICES=0 python demo.py --batch_size_v 80 --num_workers 4 --forward_save_path demo/forward
Namespace(G_GAN=1, G_VGG=1, G_nn=1, batch_size_t=128, batch_size_v=80, beta1=0.5, dataroot=False, dataset='MPV', dataset_mode='regular', decay_iters=10, epoch=200, face_L1=10, face_gan=3, face_img_L1=1, face_residual=False, face_vgg=1, fine_height=256, fine_width=192, forward='normal', forward_save_path='demo/forward', gan_mode='lsgan', gpu_ids=[0, 1, 2, 3], grid_size=5, init_gain=0.02, init_type='normal', input_nc_D_app=6, input_nc_D_face=6, input_nc_D_parsing=56, input_nc_G_app=26, input_nc_G_face=6, input_nc_G_parsing=36, isdemo=False, isval=False, joint=False, joint_G_parsing=1, joint_all=False, joint_parse_loss=False, lambda_L1=1, lr=0.0002, mask=1, mask_tvloss=False, momentum=0.9, n_layers_D=3, ndf=64, netD_app='resnet_blocks', netD_face='resnet_blocks', netD_parsing='basic', netG_app='treeresnet', netG_face='treeresnet', netG_parsing='unet_256', ngf=64, no_dropout=False, norm='instance', num_workers=4, output_nc_app=4, output_nc_face=3, output_nc_parsing=20, pool_size=100, print_freq=10, resume_D_app='', resume_D_face='', resume_D_parse='', resume_G_app='pretrained_checkpoint/app.tar', resume_G_face='pretrained_checkpoint/face.tar', resume_G_parse='pretrained_checkpoint/parsing.tar', resume_gmm='pretrained_checkpoint/step_009000.pth', save_epoch_freq=1, save_time=False, size=(256, 192), start_epoch=0, suffix='', train_mode='parsing', use_gmm=False, val_freq=200, warp_cloth=False, weight_decay=0.0001)
initialization method [normal]
initialization method [normal]
initialize network with normal
initialize network with normal
initialize network with normal
====================
====================
====================
====================
==>loaded model
Traceback (most recent call last):
File "demo.py", line 184, in <module>
forward(opt, paths, 4, opt.forward_save_path)
File "demo.py", line 106, in forward
for i, result in enumerate(val_dataloader):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 1085, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 1111, in _process_data
data.reraise()
File "/usr/local/lib/python3.6/dist-packages/torch/_utils.py", line 428, in reraise
raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/collate.py", line 73, in default_collate
return {key: default_collate([d[key] for d in batch]) for key in elem}
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/collate.py", line 73, in <dictcomp>
return {key: default_collate([d[key] for d in batch]) for key in elem}
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/collate.py", line 55, in default_collate
return torch.stack(batch, 0, out=out)
RuntimeError: stack expects each tensor to be equal size, but got [1, 256, 192] at entry 0 and [1, 256, 192, 3] at entry 4
I don't understand why it is showing it this why with my custom image.