grimoire/mmdetection-to-tensorrt

Bug: Generalized Focal Loss

Yuanye-F opened this issue · 1 comments

There is a problem for the conversion of Generalized Focal Loss module.

There is a warning:

WARNING:root:can't find wrap module for type:<class 'mmdet.models.detectors.gfl.GFL'>, use <class 'mmdet2trt.models.detectors.two_stage.TwoStageDetectorWraper'> instead.

I cannot continue to convert the module in GTX 1080 as:

Traceback (most recent call last):
File "tools/TRTconvert.py", line 173, in
main()
File "tools/TRTconvert.py", line 155, in main
max_workspace_size=max_workspace_size)
File "/home/fyy/Downloads/mmdetection-to-tensorrt/mmdet2trt/mmdet2trt.py", line 99, in mmdet2trt
wrap_model = build_wraper(torch_model, TwoStageDetectorWraper)
File "/home/fyy/Downloads/mmdetection-to-tensorrt/mmdet2trt/models/builder.py", line 36, in build_wraper
wrap_model = default_wraper(module)
File "/home/fyy/Downloads/mmdetection-to-tensorrt/mmdet2trt/models/detectors/two_stage.py", line 18, in init
mmdet_rpn_head = self.model.rpn_head
File "/home/fyy/anaconda3/envs/mmdec/lib/python3.6/site-packages/torch/nn/modules/module.py", line 594, in getattr
type(self).name, name))
AttributeError: 'GFL' object has no attribute 'rpn_head'

but the conversion will be successful using Tesla T4 with the same warning.

Could you please figure out the problem?

Seems your are not using the latest version on mmdet2trt.
Please reinstall torch2trt_dynamic, amirstan_plugin, mmdet2trt and try again.