Problem run python binding

Please provide complete information as applicable to your setup.

• Hardware Platform:Jetson Xavier NX
• DeepStream Version: 6.1
• JetPack Version: 5.0.1 DP
• TensorRT Version: 8.4.0.11
**• pip list: Package Version


absl-py 1.4.0
alabaster 0.7.13
antlr4-python3-runtime 4.9.3
anyio 3.7.0
ast_decompiler 0.7.0
astatine 0.3.2
astor 0.8.1
astpretty 3.0.0
astroid 2.15.5
asttokens 2.2.1
attrs 23.1.0
autoflake 1.7.8
Babel 2.12.1
bandit 1.7.5
black 23.3.0
boto3 1.26.139
botocore 1.29.139
build 0.10.0
cachetools 5.3.0
certifi 2023.5.7
chardet 5.1.0
charset-normalizer 3.1.0
click 8.1.3
cmake 3.26.3
cognitive-complexity 1.3.0
colorama 0.4.6
coloredlogs 15.0.1
contourpy 1.0.7
coverage 7.2.6
cycler 0.11.0
darglint 1.8.1
Deprecated 1.2.13
dill 0.3.6
distlib 0.3.6
dlint 0.14.1
doc8 1.1.1
docformatter 1.7.1
docutils 0.19
domdf-python-tools 3.6.1
einops 0.3.2
eradicate 2.2.0
exceptiongroup 1.1.1
fastapi 0.95.2
filelock 3.12.0
flake8 5.0.4
flake8-2020 1.8.0
flake8-aaa 0.15.0
flake8-annotations 3.0.1
flake8-annotations-complexity 0.0.7
flake8-annotations-coverage 0.0.6
flake8-bandit 4.1.1
flake8-black 0.3.6
flake8-blind-except 0.2.1
flake8-breakpoint 1.1.0
flake8-broken-line 0.6.0
flake8-bugbear 23.3.12
flake8-builtins 1.5.3
flake8-class-attributes-order 0.1.3
flake8-coding 1.3.2
flake8-cognitive-complexity 0.1.0
flake8-comments 0.1.2
flake8-comprehensions 3.12.0
flake8-debugger 4.1.2
flake8-django 1.3
flake8-docstrings 1.7.0
flake8-encodings 0.5.0.post1
flake8-eradicate 1.4.0
flake8-executable 2.1.3
flake8-expression-complexity 0.0.11
flake8-fastapi 0.7.0
flake8-fixme 1.1.1
flake8-functions 0.0.8
flake8-functions-names 0.4.0
flake8-future-annotations 0.0.5
flake8-helper 0.2.1
flake8-isort 6.0.0
flake8-literal 1.3.0
flake8-logging-format 0.9.0
flake8-markdown 0.4.0
flake8-mutable 1.2.0
flake8-no-pep420 2.4.0
flake8-noqa 1.3.1
flake8-pie 0.16.0
flake8-plugin-utils 1.3.2
flake8-pyi 22.11.0
flake8-pylint 0.2.0
flake8-pytest-style 1.7.2
flake8-quotes 3.3.2
flake8-rst-docstrings 0.3.0
flake8-secure-coding-standard 1.4.0
flake8_simplify 0.20.0
flake8-string-format 0.3.0
flake8-tidy-imports 4.8.0
flake8-typing-imports 1.14.0
flake8-use-fstring 1.4
flake8-use-pathlib 0.3.0
flake8-useless-assert 0.4.4
flake8-variables-names 0.0.5
flake8-warnings 0.4.0
flatbuffers 23.5.9
fonttools 4.39.4
future 0.18.3
gitdb 4.0.10
GitPython 3.1.31
google-auth 2.18.1
google-auth-oauthlib 1.0.0
grpcio 1.54.2
humanfriendly 10.0
hydra-core 1.3.2
hypothesis 6.75.6
hypothesmith 0.1.9
idna 3.4
imagesize 1.4.1
importlib-metadata 6.6.0
importlib-resources 5.12.0
iniconfig 2.0.0
isort 5.12.0
Jinja2 3.1.2
jmespath 1.0.1
json-tricks 3.16.1
jsonschema 4.17.3
jupyterlab-flake8 0.7.1
kiwisolver 1.4.4
lark-parser 0.12.0
lazy-object-proxy 1.9.0
libcst 0.4.10
Markdown 3.4.3
markdown-it-py 2.2.0
MarkupSafe 2.1.2
matplotlib 3.7.1
mccabe 0.7.0
mdurl 0.1.2
mpmath 1.3.0
mr-proper 0.0.7
mypy-extensions 1.0.0
natsort 8.3.1
networkx 3.1
numpy 1.23.0
oauthlib 3.2.2
omegaconf 2.3.0
onnx 1.13.0
onnx-simplifier 0.3.10
onnxoptimizer 0.3.13
onnxruntime 1.13.1
onnxsim 0.4.28
opencv-python 4.7.0.72
packaging 23.1
pandas-vet 0.2.3
pathspec 0.10.3
pbr 5.11.1
pep8-naming 0.13.3
pgi 0.0.11.2
Pillow 9.5.0
pip 23.1.2
pip-tools 6.13.0
pkg_resources 0.0.0
pkgutil_resolve_name 1.3.10
platformdirs 3.5.1
pluggy 1.0.0
protobuf 3.20.3
psutil 5.9.5
pyasn1 0.5.0
pyasn1-modules 0.3.0
pybetter 0.4.1
pycairo 1.23.0
pycln 2.1.3
pycocotools 2.0.4
pycodestyle 2.9.1
pydantic 1.10.8
pyDeprecate 0.3.2
pydocstyle 6.3.0
pyds 1.1.3
pyemojify 0.2.0
pyflakes 2.5.0
Pygments 2.15.1
PyGObject 3.44.1
pylint 2.17.4
pyparsing 2.4.5
pyproject_api 1.5.1
pyproject_hooks 1.0.0
pyrsistent 0.19.3
pytest 7.3.1
pytest-cov 4.1.0
pytest-sugar 0.9.7
python-dateutil 2.8.2
python-dev-tools 2023.3.24
pytz 2023.3
pyupgrade 3.4.0
PyYAML 6.0
rapidfuzz 3.0.0
removestar 1.3.1
requests 2.31.0
requests-oauthlib 1.3.1
restructuredtext-lint 1.4.0
rich 13.3.5
rsa 4.9
s3transfer 0.6.1
scipy 1.10.1
setuptools 44.0.0
six 1.16.0
smmap 5.0.0
sniffio 1.3.0
snowballstemmer 2.2.0
sortedcontainers 2.4.0
Sphinx 6.2.1
sphinx-rtd-theme 1.2.1
sphinxcontrib-applehelp 1.0.4
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.1
sphinxcontrib-jquery 4.1
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
ssort 0.11.6
starlette 0.27.0
stdlib-list 0.8.0
stevedore 5.1.0
stringcase 1.2.0
super-gradients 3.1.1
sympy 1.12
tensorboard 2.13.0
tensorboard-data-server 0.7.0
termcolor 2.3.0
tokenize-rt 5.0.0
tomli 2.0.1
tomlkit 0.11.8
torch 1.13.1
torchmetrics 0.8.0
torchvision 0.14.1
tox 4.5.2
tox-travis 0.12
tqdm 4.65.0
treelib 1.6.1
typer 0.7.0
typing_extensions 4.6.1
typing-inspect 0.9.0
untokenize 0.1.1
urllib3 1.26.16
virtualenv 20.23.0
Werkzeug 2.3.4
wheel 0.40.0
wrapt 1.15.0
zipp 3.15.0
**
I folks,
I try to run yolo-nas with deepstream I use the git: https://github.com/marcoslucianops/DeepStream-Yolo
I succsed to run, now I want use python bindings first I try to run sample example : deepstream-test1
Unfortntaly I get this Error:

Creating Pipeline 
 
Creating Source 
 
Creating H264Parser 

Creating Decoder 

Creating nv3dsink 

Playing file /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 
Adding elements to Pipeline 

Linking elements in the Pipeline 

Starting pipeline 

Error: gst-core-error-quark: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure. (4): gstbasesink.c(5367): gst_base_sink_change_state (): /GstPipeline:pipeline0/GstNv3dSink:nv3d-sink:
Failed to start

Process finished with exit code 0`
type or paste code here

I work on jetson xavier I connect with ssh from pycharm profeesonal
I will be happy to any help.

1 Like

Do you have a monitor?
If the monitor is plugged,try

export DISPLAY=:0 or 1 // xrandr to check display environment exported or not.

nv3d-sink can’t work fine without display.

Or

When there is no display, you can use fakesink instead of nv3d-sink

Thanks

Thank for reply,
I change DISPLAY:=1 know I get this error

Creating Pipeline 
 
Creating Source 
 
Creating H264Parser 

Creating Decoder 

Creating nv3dsink 

Playing file /opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 
Adding elements to Pipeline 

Linking elements in the Pipeline 

Starting pipeline 

Opening in BLOCKING MODE 
0:00:03.790200961  5295      0x1cf6350 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::initialize() <nvdsinfer_context_impl.cpp:1161> [UID = 1]: Warning, OpenCV has been deprecated. Using NMS for clustering instead of cv::groupRectangles with topK = 20 and NMS Threshold = 0.5
WARNING: Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-6.1/sources/deepstream_python_apps/apps/deepstream-test1/../../../../samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine open error
0:00:13.956053842  5295      0x1cf6350 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1888> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-6.1/sources/deepstream_python_apps/apps/deepstream-test1/../../../../samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine failed
0:00:14.036072180  5295      0x1cf6350 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1993> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-6.1/sources/deepstream_python_apps/apps/deepstream-test1/../../../../samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine failed, try rebuild
0:00:14.036177046  5295      0x1cf6350 INFO                 nvinfer gstnvinfer.cpp:646:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1914> [UID = 1]: Trying to create engine from model files
WARNING: Serialize engine failed because of file path: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine opened error
0:01:37.377681393  5295      0x1cf6350 WARN                 nvinfer gstnvinfer.cpp:643:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:1941> [UID = 1]: failed to serialize cude engine to file: /opt/nvidia/deepstream/deepstream-6.1/samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
INFO: [Implicit Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1         3x368x640       
1   OUTPUT kFLOAT conv2d_bbox     16x23x40        
2   OUTPUT kFLOAT conv2d_cov/Sigmoid 4x23x40         

0:01:37.462598310  5295      0x1cf6350 INFO                 nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-inference> [UID 1]: Load new model:dstest1_pgie_config.txt sucessfully
Error: gst-stream-error-quark: Internal data stream error. (1): gstbaseparse.c(3666): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264-parser:
streaming stopped, reason not-negotiated (-4)

this error I get when I run dee[stream-test1 from the terminal, but when I try run the code using pycharm professonal with ssh (from the python script) I get this error

Error: gst-core-error-quark: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure. (4): gstbasesink.c(5367): gst_base_sink_change_state (): /GstPipeline:pipeline0/GstNv3dSink:nv3d-sink:
Failed to start

The program which you run is deepstream_test_1.py ?
This app only support h264 stream.you can run it such as

python3 deepstream_test_2.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264

Thank you again, I see some progress when I run your command from the terminal everything works but when I try to run the Python script from my computer (I connect with ssh to jetson Xavier) I got this error:

Error: gst-core-error-quark: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure. (4): gstbasesink.c(5367): gst_base_sink_change_state (): /GstPipeline:pipeline0/GstNv3dSink:nv3d-sink:
Failed to start

You can try above post.
The value of DISPLAY depends on your configuration.A physical display is necessary.

I’m sorry but I don’t think that I really understand your answer. My DISPLAY:=1 and everything works from the terminal command why it’s different when I try to run from pycharm?
Maybe when I run from pycharm I need to add something?

Your pycharm is running on your workstation ?

On Jetson, running a DeepStream application over SSH (via putty) with X11 forwarding
does not work.

I think pycharm with ssh can’t work fine in this scenario

In the pass I run Deepstream 6.0.1 with JP 4.6 on jetson nano from Pycharm with ssh and evreything work fine so what is the diffrent?

If you deploy the deepstream app to jetson nano over pycharm with ssh. It’s can work fine.

It depends on how you used pycharm before,This is not a deepstream problem.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.