场景:在 snpe 环境下,使用snpe-onnx-to-dlc
命令将输出的 onnx 模型转化为 dlc
问题:转化时会报错,内容如下
Traceback (most recent call last):
File "/home/panyihe/文档 /snpe-1.31.0.qnx/lib/python/snpe/converters/onnx/onnx_to_ir.py", line 129, in ir_optimize
op_graph_optimizations.apply_graph_optimizations(graph, self.disable_batchnorm_folding, **kwargs)
File "/home/panyihe/文档 /snpe-1.31.0.qnx/lib/python/snpe/converters/common/converter_ir/op_graph_optimizations.py", line 89, in apply_graph_optimizations
OptimizationTranslations.apply_method_to_all_ops(AXES_TO_SPATIAL_FIRST_ORDER, graph)
File "/home/panyihe/文档 /snpe-1.31.0.qnx/lib/python/snpe/converters/common/converter_ir/translation.py", line 74, in apply_method_to_all_ops
self.apply_method_to_op(node.op.type, method_name, node, graph, *args)
File "/home/panyihe/文档 /snpe-1.31.0.qnx/lib/python/snpe/converters/common/converter_ir/translation.py", line 55, in apply_method_to_op
return translation.apply_method(method_name, *args)
File "/home/panyihe/文档 /snpe-1.31.0.qnx/lib/python/snpe/converters/common/converter_ir/translation.py", line 17, in apply_method
return self.indexed_methods[method_name](*args)
File "/home/panyihe/文档 /snpe-1.31.0.qnx/lib/python/snpe/converters/common/converter_ir/op_graph_optimizations.py", line 943, in axes_to_spatial_first_order
if not node.op.keepdims:
File "/home/panyihe/文档 /snpe-1.31.0.qnx/lib/python/snpe/converters/common/converter_ir/op_adapter.py", line 39, in __getattr__
raise AttributeError("op %s has no attribute %s" % (self.name, name))
AttributeError: op reduce_mean_0 has no attribute keepdims
2020-05-11 16:27:58,360 - 165 - ERROR - op reduce_mean_0 has no attribute keepdims
这个问题网上差不多,因此不知道应该从哪个方向开始入手。想问问有没有高手给点修改意见,感谢不尽。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.