使用MindSpore报错AttributeError: The 'Controller' object has no attribute 'to'.
收藏回复举报
使用MindSpore报错AttributeError: The 'Controller' object has no attribute 'to'.
发表于2024-02-23 08:45:55
0 查看

系统环境

硬件环境(Ascend/GPU/CPU): Ascend/GPU/CPU

MindSpore版本: mindspore=2.0.0

执行模式(PyNative/ Graph):不限

Python版本: Python=3.7

操作系统平台: 不限

报错信息

2.1问题描述

将pytorch转换成mindspore代码的过程中报错AttributeError: The 'Controller' object has no attribute 'to'.。

2.2脚本信息

self.controller = Controller(self.args).to(device)

其中Controller定义为:

class Controller(nn.Module):

根因分析

******此处由用户填写******

解决方案

******此处由用户填写******

包含文字方案和最终脚本代码

请将正确的脚本打包并上传附件

我要发帖子