PF-AFN
PF-AFN copied to clipboard
Run the training files with pytorch 1.7
When I try to run the training, I have the following errors:
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?
I hava the same question while using pytorch1.8.0.
@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.
@lyx0208 Thanks, I'll try it later
@lyx0208 Hava you ever got this error?
hello,I ran into the same problem as you. I followed your way, but it didn’t solve the problem