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

Fix different devices bug when moving model from GPU to CPU #5110

Merged
merged 6 commits into from
Oct 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Indent fix
  • Loading branch information
glenn-jocher authored Oct 10, 2021
commit 204b8bb0fb0dfdeebcfc9fab3287f0e91d2e3a67
4 changes: 2 additions & 2 deletions models/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ def _apply(self, fn):
self = super()._apply(fn)
m = self.model[-1] # Detect()
glenn-jocher marked this conversation as resolved.
Show resolved Hide resolved
if isinstance(m, Detect):
m.stride = fn(m.stride)
m.grid = list(map(fn, m.grid))
m.stride = fn(m.stride)
m.grid = list(map(fn, m.grid))
return self


Expand Down