geyuying / PF-AFN

Official code for "Parser-Free Virtual Try-on via Distilling Appearance Flows", CVPR 2021.
546 stars 138 forks source link

Run the training files with pytorch 1.7 #16

Open lyx0208 opened 3 years ago

lyx0208 commented 3 years ago

When I try to run the training, I have the following errors: image It seems that this error is caused by my version of PyTorch, so is anyone able to run the training with higher version of pytorch?

kris-yangjs commented 3 years ago

I hava the same question while using pytorch1.8.0.

lyx0208 commented 3 years ago

@kris-yangjs I solve this problem. The cause of the problem is: for the lower version of torch if the input of a maxpool of stride 2 is 2 1, it will return a result of 1 1 with no error. But for a higher version, it returns an error. I solve this problem with a tricky way: I add some codes to the maxpool_2d function, uses "expand_as" function of tensor to change the 2 1 tensor to 2 2, and I get the correct training result with this method. image

kris-yangjs commented 3 years ago

@lyx0208 Thanks, I'll try it later

kris-yangjs commented 3 years ago

@lyx0208 Hava you ever got this error? image

Zibin-Z commented 3 years ago

hello,I ran into the same problem as you. I followed your way, but it didn’t solve the problem