Toybrick

楼主: kitedream

请问多久会支持pytorch框架?据说onnx要散伙了

granis

注册会员

积分
73
11#
发表于 2019-3-14 10:52:40 | 只看该作者
jefferyzhang 发表于 2019-3-14 09:25
这个log看是匹配反卷积层时候出现问题,并不是op不支持。
先测试下你的模型转成onnx后是否可以正常推理, ...

我们用这个模型转了Mace和NCNN都没有问题。
回复

使用道具 举报

hunterZhang

注册会员

积分
159
12#
发表于 2019-4-23 10:10:13 | 只看该作者
When I convert pytorch to onnx;
Traceback (most recent call last):
  File "eval.py", line 940, in <module>
    model_onnx_path)
  File "/usr/local/lib/python3.5/dist-packages/torch/onnx/__init__.py", line 27, in export
    return utils.export(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 104, in export
    operator_export_type=operator_export_type)
  File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 281, in _export
    example_outputs, propagate)
  File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 224, in _model_to_graph
    graph, torch_out = _trace_and_get_graph_from_model(model, args, training)
  File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 192, in _trace_and_get_graph_from_model
    trace, torch_out = torch.jit.get_trace_graph(model, args, _force_outplace=True)
  File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 39, in set_training
    yield
  File "/usr/local/lib/python3.5/dist-packages/torch/onnx/utils.py", line 192, in _trace_and_get_graph_from_model
    trace, torch_out = torch.jit.get_trace_graph(model, args, _force_outplace=True)
  File "/usr/local/lib/python3.5/dist-packages/torch/jit/__init__.py", line 197, in get_trace_graph
    return LegacyTracedModule(f, _force_outplace)(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/torch/jit/__init__.py", line 253, in forward
    out_vars, _ = _flatten(out)
RuntimeError: Only tuples, lists and Variables supported as JIT inputs, but got dict

I could not figure out where is wrong, seems ONNX sets some limitations for its usage.
Hope direct pytorch conversion could be released ASAP
回复

使用道具 举报

farces

新手上路

积分
48
QQ
13#
发表于 2019-10-28 11:16:28 | 只看该作者
jefferyzhang 发表于 2019-3-3 18:38
keras和pytorch我都已经向有关部门提过需求了,一起等吧,我相信不久的将来就会支持
毕竟目前最流 ...

pytorch大概什么时间支持?
回复

使用道具 举报

jefferyzhang

版主

积分
12940
14#
发表于 2019-10-28 14:08:08 | 只看该作者
farces 发表于 2019-10-28 11:16
pytorch大概什么时间支持?

快了。具体时间点我也不懂,NPU部门也只是回我已经在做了。

目前情况下都是可以通过先转onnx后再转rknn的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表