PF-AFN icon indicating copy to clipboard operation
PF-AFN copied to clipboard

Run the training files with pytorch 1.7

Open lyx0208 opened this issue 3 years ago • 5 comments

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?

lyx0208 avatar Mar 26 '21 06:03 lyx0208

I hava the same question while using pytorch1.8.0.

kris-yangjs avatar Apr 02 '21 05:04 kris-yangjs

@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

lyx0208 avatar Apr 02 '21 05:04 lyx0208

@lyx0208 Thanks, I'll try it later

kris-yangjs avatar Apr 08 '21 05:04 kris-yangjs

@lyx0208 Hava you ever got this error? image

kris-yangjs avatar May 13 '21 01:05 kris-yangjs

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

Zibin-Z avatar May 21 '21 06:05 Zibin-Z