insight-platform / Savant

Python Computer Vision & Video Analytics Framework With Batteries Included
https://savant-ai.io
Apache License 2.0
543 stars 44 forks source link

ModuleNotFoundError during Savant gst plugins init #578

Closed abramov-oleg closed 9 months ago

abramov-oleg commented 9 months ago

Starting any sample currently logs messages like:

ModuleNotFoundError: No module named 'media_files_src_bin'
ModuleNotFoundError: No module named 'zeromq_sink'
ModuleNotFoundError: No module named 'savant_rs_serializer'
ModuleNotFoundError: No module named 'savant_parse_bin'
ModuleNotFoundError: No module named 'ffmpeg_src'
ModuleNotFoundError: No module named 'fps_meter'
ModuleNotFoundError: No module named 'adjust_timestamps'

in the module and ao rtsp containers.

These messages also register as failed pytest runs in the integration tests.

The errors go away if commenting out this import line https://github.com/insight-platform/Savant/blob/ddd3ddad7ea08392451564725628b076ff9a6431/gst_plugins/python/pyfunc.py#L18C52-L18C52

Run

docker run -it --rm --gpus all --entrypoint gst-inspect-1.0  -e GST_DEBUG=5 -e GST_DEBUG_NO_COLOR=1 ghcr.io/insight-platform/savant-deepstream:latest

To see gst python plugin load error messages of a form:

0:00:00.658603646     8 0x55e6d8808400 DEBUG               pyplugin gstpythonplugin.c:48:gst_python_plugin_load_file: loading plugin media_files_src_bin
0:00:00.658744603     8 0x55e6d8808400 DEBUG               pyplugin gstpythonplugin.c:62:gst_python_plugin_load_file: Could not load module, ignoring plugin media_files_src_bin
ModuleNotFoundError: No module named 'media_files_src_bin'
tomskikh commented 9 months ago

The problem is in from savant.config.schema import MetricsParameters inside savant.metrics. Moved build_metrics_exporter to savant.deepstream.utils.pipeline. Probably this was causing a cycled import: savant.metrics -> savant.config.schema -> savant.base.pyfunc -> savant.gstreamer -> gst_plugins.pyfunc -> savant.metrics