1. 问题描述
1.1 在使用pytorch0.4.1推理pyramidbox 或者SSD时,发生以下报错:
RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.FloatTensor for argument #2 'other'
在pytorch0.3上面应该时不报错的,改成0.4之后发生报错。
Traceback (most recent call last):
File "test.py", line 241, in <module>
det0 = detect_face(image, shrink)
File "test.py", line 60, in detect_face
y = net(x)
File "....../lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "....../pyramidbox/pyramid.py", line 452, in forward
self.priors.type(type(x.data)) # default boxes
File "....../pyramidbox/layers/functions/detection.py", line 46, in forward
decoded_boxes = decode(loc_data[i], prior_data, self.variance)
File "....../pyramidbox/layers/box_utils.py", line 231, in decode
priors[:,