Forums - snpe-pytorch-to-dlc does not work with error ""NotImplementedError: "

2 posts / 0 new
Last post
snpe-pytorch-to-dlc does not work with error ""NotImplementedError: "
DONGYU.GWAK
Join Date: 22 Apr 15
Posts: 2
Posted: Wed, 2024-01-24 21:01

I tried to convert an pytorch *.pt file to dlc with snpe 2.18.0.240101. but it failed with the message as follows

2024-01-25 04:51:19,104 - 230 - ERROR - Encountered Error: The following operators are not implemented: ['aten::new_zeros', 'aten::copy_'] Traceback (most recent call last): File "/opt/qcom/aistack/snpe/2.18.0.240101/bin/x86_64-linux-clang/snpe-pytorch-to-dlc", line 47, in main converter = PyTorchConverterFrontend(args) File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/aisw/converters/pytorch/pytorch_to_ir.py", line 40, in __init__ super(PyTorchConverterFrontend, self).__init__(args, File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/aisw/converters/relay/relay_to_ir.py", line 297, in __init__ self.importer.convert_to_relay(self.input_model_path, File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/aisw/converters/relay/importers/pytorch_importer.py", line 664, in convert_to_relay self.mod, self.params = from_pytorch(pytorch_model, input_model_path, shape_list, self.dtype_dict, File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/tvm/relay/frontend/pytorch.py", line 5350, in from_pytorch converter.report_missing_conversion(op_names, custom_op_factory) File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/tvm/relay/frontend/pytorch.py", line 4099, in report_missing_conversion raise NotImplementedError(msg) NotImplementedError: The following operators are not implemented: ['aten::new_zeros', 'aten::copy_']

I  tried to converted it with the command as follows

snpe-pytorch-to-dlc --input_network Sceneflow-IRS-BGNet-Plus.pt --input_dim input "1,1,512,640" --input_dim input "1,1,512,640" --output_path=Sceneflow-IRS-BGNet-Plus.dlc Thanks

  • Up0
  • Down0
DONGYU.GWAK
Join Date: 22 Apr 15
Posts: 2
Posted: Mon, 2024-01-29 17:53

I found a solution by myself avoiding APIs which call aten::new_zeros' and 'aten::copy_'. However, another error can be seen as follows.

2024-01-29 11:50:28,728 - 256 - INFO - Using injective.cpu for subtract based on highest priority (10)

2024-01-29 11:50:29,333 - 230 - ERROR - Encountered Error: Traceback (most recent call last):
  2: TVMFuncCall
  1: 0x00007f507d308d97
  0: tvm::relay::backend::BindParamsByName(tvm::relay::Function, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tvm::runtime::NDArray, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, tvm::runtime::NDArray> > > const&)
  File "/prj/qct/webtech_hyd18/mlg_user_admin/qaisw_source_repo/qaisw_repo_release/snpe_src/QAISW/ThirdParty/tvm/src/tvm_fork/src/relay/backend/utils.cc", line 347
TVMError: Multiple args in the function have name feature_extraction.reduce.1.bias
Traceback (most recent call last):
  File "/opt/qcom/aistack/snpe/2.18.0.240101/bin/x86_64-linux-clang/snpe-pytorch-to-dlc", line 47, in main
    converter = PyTorchConverterFrontend(args)
  File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/aisw/converters/pytorch/pytorch_to_ir.py", line 40, in __init__
    super(PyTorchConverterFrontend, self).__init__(args,
  File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/aisw/converters/relay/relay_to_ir.py", line 297, in __init__
    self.importer.convert_to_relay(self.input_model_path,
  File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/aisw/converters/relay/importers/pytorch_importer.py", line 673, in convert_to_relay
    self._post_process()
  File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/aisw/converters/relay/importers/pytorch_importer.py", line 218, in _post_process
    self.mod["main"] = bind_params_by_name(self.mod["main"], self.params)
  File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/tvm/relay/build_module.py", line 483, in bind_params_by_name
    return _build_module.BindParamsByName(func, inputs)
  File "/opt/qcom/aistack/snpe/2.18.0.240101/lib/python/qti/tvm/_ffi/_ctypes/packed_func.py", line 237, in __call__
    raise get_last_ffi_error()
qti.tvm._ffi.base.TVMError: Traceback (most recent call last):
  2: TVMFuncCall
  1: 0x00007f507d308d97
  0: tvm::relay::backend::BindParamsByName(tvm::relay::Function, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tvm::runtime::NDArray, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, tvm::runtime::NDArray> > > const&)
  File "/prj/qct/webtech_hyd18/mlg_user_admin/qaisw_source_repo/qaisw_repo_release/snpe_src/QAISW/ThirdParty/tvm/src/tvm_fork/src/relay/backend/utils.cc", line 347
TVMError: Multiple args in the function have name feature_extraction.reduce.1.bias
 

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.