Python bindings - 'pyds.NvDsFrameMeta' has no attribute 'cast'

• Hardware Platform (Jetson / GPU) Jetson nano
• DeepStream Version 5.0.0
• JetPack Version (valid for Jetson only) 4.4
• TensorRT Version 7.1.3.0
• NVIDIA GPU Driver Version (valid for GPU only)

When I ran the test in deepstream_python_apps, I always got the error of pyds:

Traceback (most recent call last):
File “deepstream_test_1_usb.py”, line 69, in osd_sink_pad_buffer_probe
frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)
AttributeError: type object ‘pyds.NvDsFrameMeta’ has no attribute ‘cast’

But I do added the bindings to /lib and also set the path for it. It seems could import pyds but fail to get cast attribute.

Did you do this,
The sample applications gets the import path for this module through common/utils.py. A setup.py is also included for installing the module into standard path:
cd /opt/nvidia/deepstream/deepstream/lib
python3 setup.py install

Hi amycao,
There is no setup.py in the directory /opt/nvidia/deepstream/deepstream/lib and /deepstream-5.0/lib. How can I get it?

In DS 5.0 GA, the bindings pyds.so should be included in /lib, you might be using an older version of pyds.so that didn’t support cast.
you can check the version by
python3
Python 3.6.9 (default, Jul 17 2020, 12:50:27)
[GCC 8.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import pyds
pyds.version
‘1.0’

Hi amycao,

Thanks for your helping. I re-downloaded the SDK and found the setup.py file. After running setup.py install, I tried to import pyds by using python3 shell and got

Traceback (most recent call last):
File “”, line 1, in
ImportError: /opt/nvidia/deepstream/deepstream-5.0/lib/pyds.so: cannot open shared object file: No such file or directory

Did I miss something? Thanks.

Can you find /opt/nvidia/deepstream/deepstream-5.0/lib/pyds.so?

Yes, I could.

Try to do it under /opt/nvidia/deepstream/deepstream-5.0/lib/


I tried. But it still doesn’t work. Should I try another way to install? Thanks.

You indeed use 5.0 GA, not 5.0 DP, right? after fully Jetpack 4.4 GA installed, python bindings will be put under /opt/nvidia/deepstream/deepstream-5.0/lib

nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream-5.0/lib$ python3
Python 3.6.9 (default, Jul 17 2020, 12:50:27)
[GCC 8.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import pyds

pyds.version
‘1.0’

nvidia@nvidia-desktop:/opt/nvidia/deepstream/deepstream-5.0/lib$