Skip to content

RuntimeError: Expected object of scalar type Double but got scalar type Float for argument #2 'weight' #33

@andkobe

Description

@andkobe

你好,我在跑test_image.py时遇到这个问题
RuntimeError: Expected object of scalar type Double but got scalar type Float for argument #2 'weight',
打印如下:
Traceback (most recent call last):
File "E:/Code/MachineLearning/DFace-master/test_image.py", line 18, in
bboxs, landmarks = mtcnn_detector.detect_face(img)
File "E:\Code\MachineLearning\DFace-master\dface\core\detect.py", line 610, in detect_face
boxes, boxes_align = self.detect_pnet(img)
File "E:\Code\MachineLearning\DFace-master\dface\core\detect.py", line 271, in detect_pnet
cls_map, reg = self.pnet_detector(feed_imgs)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "E:\Code\MachineLearning\DFace-master\dface\core\models.py", line 97, in forward
x = self.pre_layer(x)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\container.py", line 92, in forward
input = module(input)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\conv.py", line 343, in forward
return self.conv2d_forward(input, self.weight)
File "D:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\conv.py", line 340, in conv2d_forward
self.padding, self.dilation, self.groups)
RuntimeError: Expected object of scalar type Double but got scalar type Float for argument #2 'weight'

Process finished with exit code 1

有朋友遇到类似问题么?感谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions