cvlab-yonsei / EWGS

An official implementation of "Network Quantization with Element-wise Gradient Scaling" (CVPR 2021) in PyTorch.
GNU General Public License v3.0
88 stars 16 forks source link

Training problems on ImageNet #2

Closed dovedx closed 3 years ago

dovedx commented 3 years ago

Hello, author.Thank you so much for open-source code,I have some problems with this code. First,I run the code based on the Cifar10 dataset, I get the same accuracy as the original paper. Then,I use ImageNet dataset(ILSVRC2012) to do experiments,I do a 4bit quantization based on Resnet34,I train my model using pretrained model,and I didn't modify the network structure and Super parameter configuration,unfortunately,after 100epochs,I only get 71.4% (Top1) Classification accuracy,It is 73.9% in the original paper. So I hope you can help me sincerely.

junghyup-lee commented 3 years ago

Thank you for your interest. I am wondering if you use "4 levels" instead of "4 bits" when you train a model. In our implementation, the arguments weight_levels and act_levels indicate the number of discrete levels, as described in run.sh#L4. In the case of training a 4-bit quantized model (W/A=4/4), 16 is required for both of those arguments. Please check your code and let me know if you still have a problem.

dovedx commented 3 years ago

Thank you very much for your reply,I misunderstood the arguments weight_levels and act_levels。 Now,I get the same accuracy Compare with the original paper in the 2bit configuration。

Full-Speed-Ahead commented 2 years ago

Hello, I also run the code on Cifar-10 of STE method. But I got 85.4%~85.5% accuracy, which is higher than the result(84.7%) in the paper. What mistakes did I make? Thanks~~