mindspore 模型导出ONNX模型失败

脚本如下:

from mindspore.train.serialization import exportfrom mindspore import Tensorinput = np.random.uniform(0.0, 1.0, size=[1, 3, 32, 32]).astype(np.float32)

model = my_model_class()

export(model, Tensor(input),  file_name='backbone_nas', file_format='ONNX')

报错信息如下

[ERROR] ONNX(145210,python3):2021-01-06-14:16:47.278.135 [mindspore/ccsrc/transform/onnx/onnx_exporter.cc:994] ExportCNode] Need to support node op type FuncGraph2021-01-06 14:16:47.278 ERROR Failed to run pipeline.2021-01-06 14:16:47.280 ERROR Traceback (most recent call last):

  File "/home/liyong/codes/vega_1221/automl/vega/core/pipeline/pipeline.py", line 55, in run

    PipeStep().do()

  File "/home/liyong/codes/vega_1221/automl/vega/core/pipeline/nas_pipe_step.py", line 43, in do

    self._dispatch_trainer(res)

  File "/home/liyong/codes/vega_1221/automl/vega/core/pipeline/nas_pipe_step.py", line 58, in _dispatch_trainer

    self.master.run(trainer, evaluator)

  File "/home/liyong/codes/vega_1221/automl/vega/core/scheduler/local_master.py", line 48, in run

    worker.train_process()

  File "/home/liyong/codes/vega_1221/automl/zeus/trainer/trainer_base.py", line 133, in train_process

    self._train_loop()

  File "/home/liyong/codes/vega_1221/automl/zeus/trainer/trainer_base.py", line 288, in _train_loop

    self._train_epoch()

  File "/home/liyong/codes/vega_1221/automl/zeus/trainer/trainer_ms.py", line 57, in _train_epoch

    export(self.model, Tensor(input),  file_name='backbone_nas', file_format='ONNX')

  File "/root/archiconda3/envs/ci3.7/lib/python3.7/site-packages/mindspore/train/serialization.py", line 528, in export

    _export(net, file_name, file_format, *inputs)

  File "/root/archiconda3/envs/ci3.7/lib/python3.7/site-packages/mindspore/train/serialization.py", line 559, in _export

    onnx_stream = _executor._get_func_graph_proto(graph_id)

  File "/root/archiconda3/envs/ci3.7/lib/python3.7/site-packages/mindspore/common/api.py", line 562, in _get_func_graph_proto

    return self._executor.get_func_graph_proto(exec_id, ir_type)

RuntimeError: mindspore/ccsrc/transform/onnx/onnx_exporter.cc:994 ExportCNode] Need to support node op type FuncGraph

解答:

不支持的,当前MindSpore的onnx格式导出只支持resnet系列的网络。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值