pytorch runtime error: CUDNN_STATUS_MAPPING_ERROR

来源:互联网 发布:广州恒大淘宝官网首页 编辑:程序博客网 时间:2024/06/07 10:48

将训好的模型的参数赋值给另外一个网络,
在测试赋值是否正确的时候,在

output = model(input)

一直报错:

runtime error: CUDNN_STATUS_MAPPING_ERROR

多方调试无果。
参考failed to enqueue CUDNN_STATUS_MAPPING_ERROR

In Cudnn documentation about this particular error:
CUDNN_STATUS_MAPPING_ERROR
An access to GPU memory space failed, which is usually caused by a failure to bind a texture.
To correct: prior to the function call, unbind any previously bound textures.
Otherwise, this may indicate an internal error/bug in the library.

参考RuntimeError: CUDNN_STATUS_MAPPING_ERROR,
才发现是model没有放在 gpu上,而Input在 gpu上。增加

model = model.cuda()

就解决了。

原创粉丝点击