Closed flyingpot closed 5 years ago
Actually this code is not so great when I look back one year later, but I have no time and no motivation to rewrite it for the newest pytorch version.
The most deadly bug for this 'gemm+im2col' method is when padding > 0, it can't avoid extra 0(-1 in calculation) joining in calculation. This will cause the accuracy rate to drop by about 1% in VGGs model.
Back to your problem:
Thank you! I found that nn.BatchNorm2d went wrong. Though I don't know why, after removing the layer the code runs well.
Your code is great! However, when I use the code in AlexNet model, an error occurred when saving the binary model after one epoch. The log is here:
The environment is same with yours, and I succeed in other arch you provide.
The binary AlexNet code is here:
Also, the unbinarized AlexNet can run successfully.
Could you please tell me how to solve the problem? Thank you!