问题:RuntimeError:后端CPU的预期对象,但参数#2“权重”为后端CUDA

时间:2019-11-01 02:15:32

标签: python-3.x

FaceForensics代码。 识别视频的真实性

软件环境:

火炬:1.0.1

GPU:Nvidia GeForce GTX 950M

操作系统:Windows 10

Python:3.6

Traceback (most recent call last):
File "detect_from_video.py", line 239, in <module>
test_full_image_network(**vars(args))
File "detect_from_video.py", line 187, in test_full_image_network
cuda=cuda)
File "detect_from_video.py", line 95, in predict_with_model
output = model(preprocessed_image)
File "F:\ANACONDA\lib\site-packages\torch\nn\modules\module.py", line 
489, in __call__
result = self.forward(*input, **kwargs)
File "D:\Panicwq\FaceForensics-master\classification\network\models.py", 
line 113, in forward
x = self.model(x)
File "F:\ANACONDA\lib\site-packages\torch\nn\modules\module.py", line 
489, in __call__
result = self.forward(*input, **kwargs)
File "F:\ANACONDA\lib\site-packages\pretrainedmodels\models\xception.py", 
line 210, in forward
x = self.features(input)
File "F:\ANACONDA\lib\site-packages\pretrainedmodels\models\xception.py", 
line 172, in features
x = self.conv1(input)
File "F:\ANACONDA\lib\site-packages\torch\nn\modules\module.py", line 
489, in __call__
result = self.forward(*input, **kwargs)
File "F:\ANACONDA\lib\site-packages\torch\nn\modules\conv.py", line 320, 
in forward
self.padding, self.dilation, self.groups)
RuntimeError: Expected object of backend CPU but got backend CUDA for 
argument #2 'weight'

0 个答案:

没有答案