-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model Binarized Problem #17
Comments
Hi! Thank you for your interest in our work! For the first question, I think you can refer to this issue #13 for the answer. To be brief, the saved weight (those state_dicts) still contain float-valued parameters because PyTorch doesn't support binary-value operations. Also, if you want to binarize the weight, you need to follow BiReal-Net to fix model weight and re-train BN layers to absorb the scaling factor. For the second question, well, that's strange, I don't encounter such problem using the code. I guess it may be related to the PyTorch version you used. I recommend you use torch>=1.0. Also, you can use pdb to try to debug it, I don't think it is a big problem. If none of these helps, tell me and I will look into it and figure it out later. |
Actually, the second problem botherd me for several days. I use torch 1.7.0, and when I run the inital "eval_voc.py", I get the RuntimeError:Legacy autograd function with non-static forward method is deprecated. |
Hi! I am quite sure this is caused by PyTorch version. You can switch to for example torch1.2.0 and my original code will be OK. On the other hand, if you want to set some function to be staticmethod in python, you also need to delete the "self" in its input parameter list (def forward(self, x) --> def forward(x)). In addition, actually the error in the first image you post is related to this line. So you should add "@staticmethod" here. As you can see the error message points to "line 206, output = self.predict(", and self.detect is a function imported from ssd/layers/functions/detection.py. |
BTW about the pretrained BiDet weight, I didn't notice that I forgot to upload them! It's embarrassed that I didn't discover this after half a year, and I really apologize for this. I will managed to upload the pretrained weight of SSD and Faster R-CNN that can reproduce the mAP reported in the paper to this repo soon. (But you know, after CVPR and ICLR rebuttal DDL) |
Thanks for your advise. I figured out the pytorch version problem by referring amdegroot/ssd.pytorch#444. |
Sure! Thank you for your effort, I think I need to mention this in the README file of this repo. Thank you very much for figuring it out! |
Hi, I am trying to repeat the experiment in your paper, and meeting some problems in training part. I use the recommended command [python ssd/train_bidet_ssd.py --dataset="VOC" --data_root="D:\01DL\data\VOCdevkit" --basenet="D:\01DL\BiDet-master\ssd\pretrain\vgg16.pth"] to run the training and get the final model saved as " VOC_final.pth". However, the "VOC_final.pth", which I think is the parameters of the trained "BiDet_SSD model", is around 127MB. According to the paper, the output binary model should be around 20MB, since "bidet_ssd" build in bidet_ssd.py. I am confused whether I followed the incorrect way to run your code or missed any parameter setting.
In the test part, I got TypeError as follow:
Hoping for your response, thanks.
The text was updated successfully, but these errors were encountered: