文档首页> AI开发平台ModelArts> 故障排除> 训练作业> 业务代码问题> 日志提示“max_pool2d_with_indices_out_cuda_frame failed with error code 0”
更新时间:2022-12-08 GMT+08:00

日志提示“max_pool2d_with_indices_out_cuda_frame failed with error code 0”

问题现象

pytroch1.3镜像中,去升级了pytroch1.4的版本,导致之前在pytroch1.3跑通的代码报错如下:
“RuntimeError:max_pool2d_with_indices_out_cuda_frame failed with error code 0”

原因分析

出现该问题的可能原因如下:

pytorch1.4引擎与之前pytorch1.3版本兼容性问题。

处理方法

  1. 在images之后添加contigous。
    images = images.cuda()  
    pred = model(images.permute(0, 3, 1, 2).contigous())
  2. 将版本回退至pytorch1.3。
  3. 必现的问题,使用本地Pycharm远程连接Notebook调试。

建议与总结

在创建训练作业前,推荐您先使用ModelArts开发环境调试训练代码,避免代码迁移过程中的错误。