Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • X2Paddle
  • Issue
  • #247

X
X2Paddle
  • 项目概览

PaddlePaddle / X2Paddle
大约 2 年 前同步成功

通知 329
Star 698
Fork 167
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 26
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 4
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
X
X2Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 26
    • Issue 26
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 4
    • 合并请求 4
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 4月 10, 2020 by saxon_zh@saxon_zhGuest

x2paddle支持动态shape吗?

Created by: TreeDiagram-1

在进行LSTM和GRU的模型转换时遇到了下面的问题: File "./onnx_decoder.py", line 498, in check_model_running_state ipt.shape).astype(datatype) File "mtrand.pyx", line 430, in numpy.random.mtrand.RandomState.random File "mtrand.pyx", line 421, in numpy.random.mtrand.RandomState.random_sample File "_common.pyx", line 256, in numpy.random._common.double_fill TypeError: 'str' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "convert.py", line 21, in def arg_parser(): File "convert.py", line 252, in main onnx2paddle(args.model, args.save_dir, params_merge) File "convert.py", line 173, in onnx2paddle model = ONNXDecoder(model_path) File "/home/gpu/.local/lib/python3.5/site-packages/x2paddle/decoder/onnx_decoder.py", line 325, in init self.check_model_running_state(onnx_model) File "/home/gpu/.local/lib/python3.5/site-packages/x2paddle/decoder/onnx_decoder.py", line 503, in check_model_running_state "onnxruntime inference onnx model failed, Please confirm the correctness of onnx model by onnxruntime, if onnx model is correct, please submit issue in github." Exception: onnxruntime inference onnx model failed, Please confirm the correctness of onnx model by onnxruntime, if onnx model is correct, please submit issue in github. 下面是pytorch模型转换成onnx的代码,这个模型在进行onnx的check时没有报错。里面用到了dynamic_axes,所以shape会存在‘?’的情况。 dummp_inputs = torch.ones(1, 3) * 2 * np.pi inputs = ['images'] outputs = ['scores'] dynamic_axes = {'images': {1}, 'scores': {1}} torch_out = torch.onnx.export(actor_critic, dummp_inputs, "test.onnx",input_names=inputs, output_names=outputs, export_params=True,dynamic_axes=dynamic_axes) model = onnx.load("./test.onnx") onnx.checker.check_model(model)

有人知道应该怎么解决这种动态shape时遇到的问题吗?麻烦帮看一下,谢谢。

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/X2Paddle#247
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7