Forums - Error when using snpe-udo-package-generator

4 posts / 0 new
Last post
Error when using snpe-udo-package-generator
Zhe
Join Date: 22 Dec 22
Posts: 1
Posted: Wed, 2022-12-28 23:49

I tried to create a "nonzero"  operator. I folloed the UDO guide. After create the udo config file, I used the tool snpe-udo-package-generator to create udo package. But I failed with the followed error:

2022-12-29 15:33:15,225 - 219 - WARNING - Force generation is set. Deleting existing udo Package at /home/.../work/SNPE/models/MyCustomUdoPackage
Traceback (most recent call last):
  File "/home/.../work/SNPE/snpe-1.68.0.3932/bin/x86_64-linux-clang/snpe-udo-package-generator", line 35, in <module>
    config_path=args.config_path)
  File "/home/.../work/SNPE/snpe-1.68.0.3932/lib/python/qti/aisw/converters/backend/custom_ops/snpe_udo_config.py", line 243, in setup_file_paths
    self.copy_udo_dir("utils", CUSTOM_OP_DIR, cpu_util_src_dir)
NameError: name 'CUSTOM_OP_DIR' is not defined
 
Then I check the code (snpe-1.68.0.3932/lib/python/qti/aisw/converters/backend/custom_ops/snpe_udo_config.py:243) .
 
           
    if "CPU" in udo_package.supported_runtimes:
                cpu_root = os.path.join(src_dir, 'CPU')
                cpu_src_dir = os.path.join(cpu_root, 'src')
                cpu_util_src_dir = os.path.join(cpu_src_dir, 'utils')
 
                self.copy_udo_dir("utils", CUSTOM_OP_DIR, cpu_util_src_dir)
                self.make_udo_dir(os.path.join(cpu_src_dir, 'ops'))

 
 
And I find the variable defination. It looks like I need to set the env "QNN_SDK_ROOT" , then the variable 'CUSTOM_OP_DIR' will be set.
(snpe-1.68.0.3932/lib/python/qti/aisw/converters/backend/custom_ops/snpe_udo_config.py:19)
QNN_SDK_ROOT = os.getenv("QNN_SDK_ROOT")
if QNN_SDK_ROOT is not None:
    SHARE_LOC_PREFIX = os.path.join(os.path.abspath(QNN_SDK_ROOT), 'target', 'x86_64-linux-clang', 'share', 'OpPackageGenerator')
    CUSTOM_OP_DIR = os.path.join(SHARE_LOC_PREFIX, 'CustomOp')
 
But  I don't know where to download 'QNN_SDK' and if this is necessary.
 
Any ideas?
Thanks 
  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Sun, 2023-01-01 00:30

Dear developer,

The QNN SDK is no need to set to SNPE. Could you please share you conversion commands to us?

BR.

Wei

  • Up0
  • Down0
shakarim94
Join Date: 6 Jan 23
Posts: 1
Posted: Mon, 2023-01-09 05:05

It seems like there is a bug starting from SNPE 1.62. Running with SNPE 1.61 fixed the problem for me

  • Up0
  • Down0
octav.florescu
Join Date: 4 Jul 23
Posts: 3
Posted: Wed, 2023-07-26 08:36

Did you find another solution for this apart from downgrade? I am using

snpe-udo-package-generator --config_path /data/octavf/trilu.json --output_path /data/octavf/triluUDOPack

And it crashes for same path missing from
/opt/qcom/aistack/snpe/2.12.0.230626/lib/python/qti/aisw/converters/backend/custom_ops/snpe_udo_config.py
 

  • 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.