zhutmost / lsq-net

Unofficial implementation of LSQ-Net, a neural network quantization framework
MIT License
269 stars 40 forks source link

I think there are some code bugs. #12

Closed Menace-Dragon closed 3 years ago

Menace-Dragon commented 3 years ago
  1. Bug in quan\func.py at line 25: TypeError: _conv_forward() missing 1 required positional argument: 'bias', while the code is 'self._conv_forward(quantized_act, quantized_weight)'

  2. Bug in model\resnet_cifar.py at line 124: avg_pool2d(): argument 'kernel_size' (position 2) must be tuple of ints, not Tensor, while the code is 'F.avg_pool2d(out, out.size()[3])'

If these codes on your machine run without error, I guess bugs may be caused by Pytorch version. And my Pytorch version is 1.8.1.

zhutmost commented 3 years ago

Because Pytorch always modify the API of _conv_forward(), and I have not worked on this project for a long time.

zhutmost commented 3 years ago

The last time I tested my code is pytorch 1.5. I am not very sure. And I have fixed _conv_forward bug several times.

Menace-Dragon commented 3 years ago

Thank you.I have dealt with them.

kaiqi123 commented 2 years ago

Thank you.I have dealt with them.

Hi Menace-Dragon, how did you solved this issue?