pytorch runtime error: CUDNN_STATUS_MAPPING_ERROR

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

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()

就解决了。

评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值