-
Notifications
You must be signed in to change notification settings - Fork 352
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
Expected object of type torch.DoubleTensor but found type torch.FloatTensor for argument #2 'weight' #16
Comments
I met the same problem, I fix this problem by change "image = image.astype(np.float)" to "image = image.astype(np.float32)" in fuction convert_image_to_tensor, which is in the file image_tools.py |
@Lan-st I change "image = image.astype(np.float32)", got the new issues as below: |
/usr/bin/python /Users/cgf/GitHub/GitWeb/dface/test_image.py Process finished with exit code 1 |
@wting861006,I meet the same error with you, but I am running the code in mac osx, it is ok if you use ubuntu. I think it may be a bug for mac running. |
i also have same problem. i change the 'np.float', but it isn't solved. |
@guanfuchen ,I uses ubuntu. But it is not solved |
@wting861006 ,did you solved this problem? |
@HPL123 You can try use pytorch version<=0.2.0.I sloved it when use version as 0.2.0. |
@wting861006 ,Thanks,I solved it by deleting “image = image.astype(np.float)” |
With respect to the deletion of Does anyone have any insight as to what the differences could be? Does it come down to PyTorch version? |
when test the model ,got the issue as below ,plz help to check the issue
RuntimeError Traceback (most recent call last)
in ()
17
18 print("start to detect ")
---> 19 bboxs, landmarks = mtcnn_detector.detect_face(img)
20 # print box_align
21
~/jupyter/DFACE/DFace/dface/core/detect.py in detect_face(self, img)
612 # pnet
613 if self.pnet_detector:
--> 614 boxes, boxes_align = self.detect_pnet(img)
615 if boxes_align is None:
616 return np.array([]), np.array([])
~/jupyter/DFACE/DFace/dface/core/detect.py in detect_pnet(self, im)
269
270 print('type of feed_imgs:',type(feed_imgs))
--> 271 cls_map, reg = self.pnet_detector(feed_imgs)
272
273 cls_map_np = image_tools.convert_chwTensor_to_hwcNumpy(cls_map.cpu())
/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py in call(self, *input, **kwargs)
489 result = self._slow_forward(*input, **kwargs)
490 else:
--> 491 result = self.forward(*input, **kwargs)
492 for hook in self._forward_hooks.values():
493 hook_result = hook(self, input, result)
~/jupyter/DFACE/DFace/dface/core/models.py in forward(self, x)
95
96 def forward(self, x):
---> 97 x = self.pre_layer(x)
98 label = F.sigmoid(self.conv4_1(x))
99 offset = self.conv4_2(x)
The text was updated successfully, but these errors were encountered: