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

The use of SPPF #4592

Closed
Weixueying opened this issue Aug 29, 2021 · 4 comments
Closed

The use of SPPF #4592

Weixueying opened this issue Aug 29, 2021 · 4 comments
Labels
question Further information is requested Stale

Comments

@Weixueying
Copy link

❔Question

How to use SPPF on the network? I directly use SPPF to replace SPP. The following error occurs:
Traceback (most recent call last):
File "/home/zwc/project/yolov5-master-828/train.py", line 602, in
main(opt)
File "/home/zwc/project/yolov5-master-828/train.py", line 500, in main
train(opt.hyp, opt, device)
File "/home/zwc/project/yolov5-master-828/train.py", line 119, in train
model = Model(cfg, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create
File "/home/zwc/project/yolov5-master-828/models/yolo.py", line 98, in init
self.model, self.save = parse_model(deepcopy(self.yaml), ch=[ch]) # model, savelist
File "/home/zwc/project/yolov5-master-828/models/yolo.py", line 265, in parse_model
m_ = nn.Sequential(*[m(*args) for _ in range(n)]) if n > 1 else m(*args) # module
File "/home/zwc/project/yolov5-master-828/models/common.py", line 187, in init
self.m = nn.MaxPool2d(kernel_size=k, stride=1, padding=k // 2)
TypeError: unsupported operand type(s) for //: 'list' and 'int'

Additional context

@Weixueying Weixueying added the question Further information is requested label Aug 29, 2021
@glenn-jocher
Copy link
Member

@Weixueying SPPF usage is fully documented in PR #4420

@Weixueying
Copy link
Author

Hello, may I ask what is the principle of SPPF design? After I trained with my own dataset, the inference time in the test basically remained unchanged, which was not reduced as you said.
SPP: Speed: 0.1ms pre-process, 11.8ms inference, 1.5ms NMS per image at shape (8, 3, 512, 512)
SPPF:Speed: 0.1ms pre-process, 11.7ms inference, 1.5ms NMS per image at shape (8, 3, 512, 512)

@glenn-jocher
Copy link
Member

@Weixueying SPPF profiling results are documented in PR #4420 (comment)

SPPF is about 1/3 faster than SPP while producing mathematically identical results. Your results are for an entire model, of which SPPF is but a small change.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2021

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@github-actions github-actions bot added the Stale label Oct 1, 2021
@github-actions github-actions bot closed this as completed Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

2 participants