-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
TypeError: init_weights() missing 1 required positional argument: 'pretrained' #1317
Comments
Did you override the |
I think so but not sure. I think there is another model.init_weights() in train.py But When I comment it out then I'm able to train the model. I do not know is it right way or Am I missing something? |
What codebase are you using? |
mmdetection repository and training file from tools/train.py |
please provide your mmdet version and what config you are using? |
mmcv-full : 1.3.12 When I run with default mask_rcnn and config: mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_coco.py, it runs fine. |
so why the error happened? Did you modify the mask_rcnn model? |
No. Basically I'm using this custom implementation. |
@hhaAndroid have a look |
@apanand14 Please refer to https://github.com/open-mmlab/mmdetection/blob/master/docs/changelog.md#backwards-incompatible-changes. In v2.12.0 MMDetection, we have adopted |
Hello @hhaAndroid , I tried to solve this issue for custom code. But I'm getting same error no matter what I chnage. Is it possible that you look into and help me to solve it please? Here is the custom implementation I use on mmcv-full 1.3.12 and mmdet 2.16.0 . As you mentioned backward incompatibale changes causes above mentioned error. Can you help me to run this custom implementation on mmcv-full and mmdet (latest versions)? https://github.com/zhanggang001/RefineMask
As I told you before, I use init_cfg in cfg file. Also, I do not get any error while I train with default Mask Rcnn. (Training and inference works well). In custom implementation, training works if I make a comment of model.init_weights() but it throws an error (mentioned in title) with it. Please help me out. Thank you in advance!! |
If you do not want to modify the current code, I suggest that your mmdet version should not be higher than v2.12.0, because there is BC-Breaking. |
Thank you for the reply. I will try to downgrade mmdet version and check it out. |
hi @apanand14 , is there any progress? |
Hello @zhouzaida , I'm able to run the customized mmdetection by installing the lower versions. Thank you for your help. I will let you know once I change the code on the latest versions of the mmdetection and then it works or not. |
hi @apanand14 , is there any progress? |
No, I'm focused on the training and optimizing stuffs with lower versions only. I will let you know in maximum weeks. |
File "tools/train.py", line 189, in
main()
File "tools/train.py", line 163, in main
model.init_weights()
File "C:\Users\topseven\anaconda3\envs\mmcv\lib\site-packages\mmcv\runner\base_module.py", line 117, in init_weights
m.init_weights()
TypeError: init_weights() missing 1 required positional argument: 'pretrained'
The text was updated successfully, but these errors were encountered: