Skip to content
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

RepVGG模型加载 #24

Closed
OpenCDR opened this issue May 19, 2021 · 2 comments
Closed

RepVGG模型加载 #24

OpenCDR opened this issue May 19, 2021 · 2 comments

Comments

@OpenCDR
Copy link

OpenCDR commented May 19, 2021

您好,我尝试把RepVGG的backbone加到YOLOv5中,但现在报错信息如下:
Traceback (most recent call last):
File "/home/xxx/Desktop/flexible-yolov5/scripts/train.py", line 531, in
train(hyp, opt, device, tb_writer)
File "/home/xxx/Desktop/flexible-yolov5/scripts/train.py", line 91, in train
model = Model(opt.cfg).to(device) # create
File "/home/xxx/Desktop/flexible-yolov5/od/models/model.py", line 26, in init
backbone_out = self.backbone.out_shape
File "/home/xxx/Softwares/anaconda/envs/welding/lib/python3.7/site-packages/torch/nn/modules/module.py", line 948, in getattr
type(self).name, name))
AttributeError: 'RepVGG' object has no attribute 'out_shape'
您知道应该怎么修改模型吗?

@OpenCDR OpenCDR closed this as completed May 20, 2021
@Bobo-y
Copy link
Owner

Bobo-y commented May 20, 2021

在RepVGG 加一个字典,像这样的,构建FPN时需要传入backbone的每一层输出的channel
self.out_shape = {'C3_size': self.out_channels[-3],
'C4_size': self.out_channels[-2],
'C5_size': self.out_channels[-1]}

@OpenCDR

@OpenCDR
Copy link
Author

OpenCDR commented May 20, 2021

好的谢谢您。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants