MindSpore报错RuntimeError: The 'getitem' operation does not support the type [Func, Int64].
收藏回复举报
MindSpore报错RuntimeError: The 'getitem' operation does not support the type [Func, Int64].
发表于2023-02-21 14:20:22
0 查看

1 系统环境

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

MindSpore版本: 1.7.0

执行模式(PyNative/ Graph): Graph

Python版本: Python=3.9.15

操作系统平台: 不限

2 报错信息

2.1  问题描述

静态图模式下的construct函数中对SequentialCell通过下标访问元素出错,“SequentialCell[-1]” 语法不支持。

2.2  报错信息

RuntimeError: The 'getitem' operation does not support the type [Func, Int64].

2.3  脚本代码

可根据描述自行构造

3 根因分析

******此处由用户补充详细的定位过程******

静态图模式不支持SequentialCell的getitem操作。如果需要执行getitem操作,建议使用nn.CellList。

4 解决方案

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

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

支持上传附件

我要发帖子