sangyun884 / HR-VITON

Official PyTorch implementation for the paper High-Resolution Virtual Try-On with Misalignment and Occlusion-Handled Conditions (ECCV 2022).
837 stars 177 forks source link

train_generator.py not working for me #55

Open OliverVarnce opened 1 year ago

OliverVarnce commented 1 year ago

I have trained my model in train_condition.py. As results, I have tocg_final.pth and D_final.pth.

But.... I'm trying to execute train_generator.py as python3 train_generator.py --cuda True --name test -b 4 -j 8 --gpu_ids 0 --tocg_checkpoint checkpoints/test/tocg_final.pth --occlusion

But have an error in first step:

Traceback (most recent call last): File "train_generator.py", line 706, in main() File "train_generator.py", line 696, in main train(opt, train_loader, test_loader, test_vis_loader, board, tocg, generator, discriminator, model) File "train_generator.py", line 297, in train fake_concat = torch.cat((parse, output_paired), dim=1) RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 192 but got size 128 for tensor number 1 in the list.

I'm using 192x296 size of my images and prepared dataset, I have --fine_width 192 --fine_height 296 as default in code.

What's wrong?

UPD: I think the problem is in output_paired = generator(torch.cat((agnostic, pose, warped_cloth_paired), 1), parse) size of tensor in output is not 192, but 128. How it works, I still don't understand....

OliverVarnce commented 1 year ago
> agnostic                           3       torch.Size([8, 3, 256, 192])
> pose                               3       torch.Size([8, 3, 256, 192])
> warped_cloth_paired                3       torch.Size([8, 3, 256, 192])
> parse                              7       torch.Size([8, 7, 256, 192])
> output_paired                      3       torch.Size([8, 3, 256, 128])

Why output_paired is 128?