Traceback (most recent call last): File "D:/Taoyoufeng/detr_1/detr-pytorch-master/predict.py", line 14, in <module> detr = Detection_Transformers() File "D:\Taoyoufeng\detr_1\detr-pytorch-master\detr.py", line 79, in __init__ self.generate() File "D:\Taoyoufeng\detr_1\detr-pytorch-master\detr.py", line 90, in generate self.net = DETR(self.backbone, 'sine', 256, self.num_classes, num_queries=100) AttributeError: 'Detection_Transformers' object has no attribute 'backbone' Process finished with exit code 1
时间: 2023-06-20 16:10:15 浏览: 91
这个错误提示显示在执行 `predict.py` 文件时出错了,具体是因为 `Detection_Transformers` 类没有属性 `backbone`,而在 `generate()` 方法中又使用了这个属性。可能需要查看代码并确保 `backbone` 属性已经被正确定义和初始化。另外,还需要确保 `num_classes` 属性也已经被正确定义和初始化。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)