You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: