MindSpore:【AIR模型导出】导出时提示源码中select_op参数类型转换失败

问题描述:

【功能模块】

MindSpore - 模型导出 - AIR模型导出

【操作步骤&问题现象】

1、脚本在GPU和Ascend环境下正常运行,可以正常运行,结果也正常

2、Ascend中导出AIR模型时遭遇select算子Cast错误,脚本中并未使用select算子

【截图信息】

【日志信息】

  • [WARNING] GE_ADPT(143,python):2021-03-12-15:15:58.486.295 [mindspore/ccsrc/transform/graph_ir/op_adapter_util.cc:134] VectorToTensorUtil] Convert a none tuple to an empty ge tensor

  • [ERROR] GE_ADPT(143,python):2021-03-12-15:15:58.498.824 [mindspore/core/ir/anf.h:431] GetValue] Cast failed, original value: 101, type: Int32Imm

  • Traceback (most recent call last):

  • File "/home/work/user-job-dir/BLSBasic/BLSBasicTrainFor_1_0.py", line 325, in <module>

  • export(bls, train_data, train_label, file_name="bls.air", file_format='AIR')

  • File "/usr/local/ma/python3.7/lib/python3.7/site-packages/mindspore/train/serialization.py", line 537, in export

  • _export(net, file_name, file_format, *inputs)

  • File "/usr/local/ma/python3.7/lib/python3.7/site-packages/mindspore/train/serialization.py", line 562, in _export

  • graph_id, _ = _executor.compile(net, *inputs, phase=phase_name)

  • File "/usr/local/ma/python3.7/lib/python3.7/site-packages/mindspore/common/api.py", line 537, in compile

  • self._build_data_graph(obj, phase)

  • File "/usr/local/ma/python3.7/lib/python3.7/site-packages/mindspore/common/api.py", line 388, in _build_data_graph

  • self._executor.build_data_graph(obj.parameters_dict(), phase, obj.parameters_broadcast_dict())

  • RuntimeError: mindspore/core/ir/anf.h:431 GetValue] Cast failed, original value: 101, type: Int32Imm

  • # In file /usr/local/ma/python3.7/lib/python3.7/site-packages/mindspore/ops/composite/multitype_ops/_compile_utils.py(504)

  • return F.select(condition, u, data)

     

解决方案:

上述问题在MindSpore1.2版本中已得到修复,可以正常使用。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值