{"id":84319,"date":"2020-05-15T22:41:06","date_gmt":"2020-05-15T14:41:06","guid":{"rendered":"http:\/\/4563.org\/?p=84319"},"modified":"2020-05-15T22:41:06","modified_gmt":"2020-05-15T14:41:06","slug":"%e5%85%b3%e4%ba%8e-onnx-%e6%a8%a1%e5%9e%8b%e8%bd%ac%e6%88%90-dlc-%e6%9c%89%e5%85%b3%e9%97%ae%e9%a2%98%e5%92%a8%e8%af%a2","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=84319","title":{"rendered":"\u5173\u4e8e onnx \u6a21\u578b\u8f6c\u6210 dlc \u6709\u5173\u95ee\u9898\u54a8\u8be2"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5173\u4e8e onnx \u6a21\u578b\u8f6c\u6210 dlc \u6709\u5173\u95ee\u9898\u54a8\u8be2               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MekoPan <\/span>  <span><i><\/i> 5<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p><strong>\u573a\u666f<\/strong>:\u5728 snpe \u73af\u5883\u4e0b\uff0c\u4f7f\u7528<code>snpe-onnx-to-dlc<\/code>\u547d\u4ee4\u5c06\u8f93\u51fa\u7684 onnx \u6a21\u578b\u8f6c\u5316\u4e3a dlc<br \/> <strong>\u95ee\u9898<\/strong>:\u8f6c\u5316\u65f6\u4f1a\u62a5\u9519\uff0c\u5185\u5bb9\u5982\u4e0b<\/p>\n<pre><code>Traceback (most recent call last):   File \"\/home\/panyihe\/\u6587\u6863 \/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\/\u6587\u6863 \/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\/\u6587\u6863 \/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\/\u6587\u6863 \/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\/\u6587\u6863 \/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\/\u6587\u6863 \/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\/\u6587\u6863 \/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 <\/code><\/pre>\n<p>\u8fd9\u4e2a\u95ee\u9898\u7f51\u4e0a\u5dee\u4e0d\u591a\uff0c\u56e0\u6b64\u4e0d\u77e5\u9053\u5e94\u8be5\u4ece\u54ea\u4e2a\u65b9\u5411\u5f00\u59cb\u5165\u624b\u3002\u60f3\u95ee\u95ee\u6709\u6ca1\u6709\u9ad8\u624b\u7ed9\u70b9\u4fee\u6539\u610f\u89c1\uff0c\u611f\u8c22\u4e0d\u5c3d\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1514022\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : MekoPan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u76ee\u524d\u60f3\u6cd5\u662f pytorch .pth \u6a21\u578b\u8f6c onnx \u65f6\u6709\u95ee\u9898\uff0c\u56e0\u6b64\u5bfc\u81f4 onnx \u6a21\u578b\u8f6c dlc \u5931\u8d25\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1514023\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : MekoPan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u66f4\u65b0\u4e00\u4e0b\u3002\u76ee\u524d\u6682\u65f6\u786e\u5b9a\u662f onnx \u6a21\u578b\u7684\u95ee\u9898\uff0c\u89e3\u51b3\u529e\u6cd5\u662f\u4fee\u6539\u4e86 snpe \u4e2d\u00b7op_graph_optimizations.py\u00b7\u548c\u00b7axis_tracker.py\u00b7\u4e24\u4e2a\u6587\u4ef6\u3002dlc \u6a21\u578b\u6210\u529f\u8f93\u51fa\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e onnx \u6a21\u578b\u8f6c\u6210 dlc &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/84319"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=84319"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/84319\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=84319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=84319"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=84319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}