[Bug] @BACKBONES.register_module() error
Prerequisite
- [X] I have searched Issues and Discussions but cannot get the expected help.
- [X] The bug has not been fixed in the latest version(https://github.com/open-mmlab/mmcv).
Environment
mmseg==0.23.0 mmcv-full==1.5.0
Reproduces the problem - code sample
1
Reproduces the problem - command or script
I did not run through the script, but put the configuration file into the train file, I guarantee that he is OK.
Reproduces the problem - error message
TypeError: module must be a class, but got <class 'function'>
Additional information
When I used to register a module, I met three situations
1.Nextvit is the module that I registered successfully .
I also tried to register the other two modules, but failed. Here 's what he looks like.
2.He first registered Vanillanet, but re-registered the vanillanet _ 5 module in another file. I can only use Vanillanet, but I don 't know how to use vanillanet _ 5.
3.The third is the module that I discussed with you before. It is not a class, but a function, and then the error message is as follows:
TypeError: module must be a class, but got <class 'function'>
I want to know how to solve the second and third cases, look forward to answering, thank you!
- What is the
register_modelin your second error? - Upgrading your mmcv to 1.5.1 can fix the third error.
Hello, first of all thank you for your answer.
- In the second error, I want to say that I will only use @ BACKBONES.register _ module ( ) instead of @ register _ model, just like the difference between Vaillanet and vaillanet _ 5 in the figure. I understand how to use Vaillanet, but I don 't know how to use vaillanet _ 5.
- In the third error,In the init ( ) under the mmseg file, write the following information: MMCV_MIN = '1.3.13' MMCV_MAX = '1.5.0' if upgrade mmcv to 1.5.1 will cause an error.