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

model.fuse() reports error messag #1386

Closed
dongzhenguo2016 opened this issue Jul 14, 2020 · 1 comment
Closed

model.fuse() reports error messag #1386

dongzhenguo2016 opened this issue Jul 14, 2020 · 1 comment

Comments

@dongzhenguo2016
Copy link

Originally model.fuse() in detect.py was commented. I want to release this line of code to see if merging conv with bn really improves the speed of inference, but the code reports the following error message:

Using CUDA device0 CudaDeviceProperties(name='GeForce RTX 2080 Ti', total_memory=10989MB)
Model Summary: 225 layers, 6.26003e+07 parameters, 6.26003e+07 gradients
Fusing layers...
Traceback (most recent call last):
File "/media/hdc/data1/dzc/yolov3-master/detect.py", line 223, in
detect()
File "/media/hdc/data1/dzc/yolov3-master/detect.py", line 61, in detect
model.fuse()
File "/media/hdc/data1/dzc/yolov3-master/models.py", line 334, in fuse
fused = torch_utils.fuse_conv_and_bn(conv, b)
File "/media/hdc/data1/dzc/yolov3-master/utils/torch_utils.py", line 93, in fuse_conv_and_bn
fusedconv.bias.copy
(torch.mm(w_bn, b_conv.reshape(-1, 1)).reshape(-1) + b_bn)# .cuda(device)
RuntimeError: Expected object of device type cuda but got device type cpu for argument #2 'mat2' in call to _th_mm

Process finished with exit code 1

I tried to search for some solutions, but none of them solved. How can I fix this bug?
thanks a lot

@dongzhenguo2016 dongzhenguo2016 added the bug Something isn't working label Jul 14, 2020
@glenn-jocher
Copy link
Member

@dongzhenguo2016 your code is way out of date. Update.

@glenn-jocher glenn-jocher removed the bug Something isn't working label Jul 14, 2020
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