sangyun884 / HR-VITON

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

python3 train_condition.py forward() missing 1 required positional argument: 'input2' #50

Open OliverVarnce opened 1 year ago

OliverVarnce commented 1 year ago

Can you help me with train_condition.py?

I have an error:

File "train_condition.py", line 499, in main() File "train_condition.py", line 490, in main train(opt, train_loader, val_loader, test_loader, board, tocg, D) File "train_condition.py", line 159, in train flow_list, fake_segmap, warped_cloth_paired, warped_clothmask_paired = tocg(input1, input2) File "/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) TypeError: forward() missing 1 required positional argument: 'input2'

What is the problem?

itouchzh commented 1 year ago

you can test add a parameter for the model? example this images, I can solve this problem in this way image

OliverVarnce commented 1 year ago

you can test add a parameter for the model? example this images, I can solve this problem in this way image

I have this error on 100th step. Whats may be wrong?

HyunseokDE commented 1 year ago

Did you solve this problem?

OliverVarnce commented 1 year ago

Did you solve this problem?

yes. Inc code we have ... = tocg(input1, input2) but should be ... = tocg(opt, input1, input2)

HyunseokDE commented 1 year ago

Did you solve this problem?

yes. Inc code we have ... = tocg(input1, input2) but should be ... = tocg(opt, input1, input2) thank you, hmm problem is persists..I need to find more

Chae-Mingi commented 1 year ago

Did you solve this problem?

OliverVarnce commented 1 year ago

Did you solve this problem?

Yes. Adding 'opt' in first parameter in call tocg solves this problem - tocg(opt, input1, input2)

111wukong commented 1 year ago

Thank you, but the method you provided did not solve the problem.

SXJCLZH commented 1 year ago

Big guy, I tried to run it again according to the method you said, but it still doesn't work. Could you please describe it in more detail or share your key code? TypeError: make_grid() missing 1 required positional argument: 'opt'

ntad27 commented 11 months ago

could anyone please describe in more detail how to fix it?

whateverisnottaken commented 11 months ago

In train_condition.py, change line 158 from ...tocg(input1, input2) to ...tocg(opt, input1, input2) change line 241 from ...mkgrid(N, iH, iW) to ...mkgrid(N, iH, iW, opt) change line 299 from ...tocg(input1, input2) to ...tocg(opt, input1, input2) change line 342 from ...tocg(input1, input2) to ...tocg(opt, input1, input2) change line 481 from ...ConditionGenerator(opt... to ...ConditionGenerator(opt=opt...

solves the problem on my machine.