AttributeError: 'RetinaNet' object has no attribute 'CLASSES'
See original GitHub issueHi,thanks for your brilliant work.I use mmdetection on my own dataset and train the retinanet_r50_fpn_1x.py.I have made MyDataset follow GETTING_STARTED,and replace the coco classes by my data classes in coco.py and core/evaluation/class_names.The trainning goes well,but when I run test.py,some error occurs:
loading annotations into memory...
Done (t=0.21s)
creating index...
index created!
[ ] 0/548, elapsed: 0s, ETA:Traceback (most recent call last):
File "tools/test.py", line 189, in <module>
main()
File "tools/test.py", line 159, in main
outputs = single_gpu_test(model, data_loader, args.show)
File "tools/test.py", line 29, in single_gpu_test
model.module.show_result(data, result, dataset.img_norm_cfg)
File "./PycharmProjects/mmdetection/mmdet/models/detectors/base.py", line 105, in show_result
class_names = self.CLASSES
File "./.conda/envs/open-mmlab/lib/python3.6/site-packages/torch/nn/modules/module.py", line 539, in __getattr__
type(self).__name__, name))
AttributeError: 'RetinaNet' object has no attribute 'CLASSES'
Can you tell me how to fix it?Thank you very much.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Error trying to train the neural network - 'Namespace' object ...
1 Answer 1 · remove these lines from fit_generator() function call or · pass arguments with its name from your command line or...
Read more >AttributeError: 'ResNet' object has no attribute 'get_features'
Hello i defined a method inside a class but i don't know why i'm getting the following error AttributeError: 'ResNet' object has no...
Read more >Changelog — MMDetection 2.26.0 documentation
num_classes to indicate the class index of background labels. This change has no effect on the pre-trained models in the v2.x model zoo,...
Read more >arcgis.learn module | ArcGIS API for Python
This format can be used with FasterRCNN, RetinaNet, SingleShotDetector and YOLOv3 models. Classified_Tiles : This option will output one classified image chip ...
Read more >module 'torch' has no attribute 'pi' - You.com | The search engine you ...
python 3.x - pytorch, AttributeError: module 'torch' has no attribute . ... Enjoy best-in-class privacy and personalized search, from your address bar.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@GuoxingYan I modify the test.py but I don’t understand the second modification,can you make it clear?BTW,after the modification in test.py,the picture can be shown but not in an automatic way,the picture update only after I press the
enter
,can you tell me why?Thx for your kind reply.I solved it in test.py modify model.module.show_result(data, result, dataset.img_norm_cfg,dataset.CLASSES) and in config/retinanet.py def show_result(self, data, result, img_norm_cfg**,CLASSES**, kwargs): super(CascadeRCNN, self).show_result(data, result, img_norm_cfg,CLASSES,** **kwargs)