mediapipe
mediapipe copied to clipboard
Docker environment using mediapipe pip package >= 0.10.8 loops indefinitely in create_from_options
OS Platform and Distribution
Linux Ubuntu 20.04 kernel version 5.15.0-91-generic x86_64
Compiler version
gcc 9.4.0
Programming Language and version
Python 3.8.10
Installed using virtualenv? pip? Conda?(if python)
pip
MediaPipe version
0.10.8
Bazel version
N/A
XCode and Tulsi versions (if iOS)
N/A
Android SDK and NDK versions (if android)
N/A
Android AAR (if android)
None
OpenCV version (if running on desktop)
4.2.0
Describe the problem
Running python script in a docker environment fails to complete. HandLandmarker.create_from_options(...) does not complete (line 11) in the code line below never completes. Signals are disabled, using SIGINT does not break out to the python shell.
Using mediapipe pip package 0.10.7, the script runs to completion as expected..
The system has a NVIDIA RTX 4000 GPU card, usign CPU delegate does not make a difference either
Complete Logs
(Pdb) p options
HandLandmarkerOptions(base_options=BaseOptions(model_asset_path='/home/ubuntu/src/hand_landmark/models/hand_landmarker.task', model_asset_buffer=None, delegate=None), running_mode=<VisionTaskRunningMode.IMAGE: 'IMAGE'>, num_hands=2, min_hand_detection_confidence=0.5, min_hand_presence_confidence=0.5, min_tracking_confidence=0.5, result_callback=None)
(Pdb) l
1 # STEP 1: Import the necessary modules.
2 import mediapipe as mp
3 from mediapipe.tasks import python
4 from mediapipe.tasks.python import vision
5
6 # STEP 2: Create an HandLandmarker object.
7 base_options = python.BaseOptions(model_asset_path='/home/ubuntu/src/hand_landmark/models/hand_landmarker.task')
8 options = vision.HandLandmarkerOptions(base_options=base_options,
9 num_hands=2)
10 print("INIT")
11 -> detector = vision.HandLandmarker.create_from_options(options)
12
13
14 print("SUCCESS")
(Pdb) n
ubuntu@ubuntu:~$ docker info
Client: Docker Engine - Community
Version: 24.0.7
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.2
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.21.0
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 6
Running: 6
Paused: 0
Stopped: 0
Images: 15
Server Version: 24.0.7
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc io.containerd.runc.v2 nvidia
Default Runtime: runc
Init Binary: docker-init
containerd version: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
runc version: v1.1.9-0-gccaecfc
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
Kernel Version: 5.15.0-91-generic
Operating System: Ubuntu 20.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 20
Total Memory: 31.06GiB
Name: ubuntu
ID: ab9fe0ee-3b64-49ae-92fb-58ba415dea20
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
ubuntu@ubuntu:~$ nvidia-smi
Sun Jan 14 22:42:14 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.23.08 Driver Version: 545.23.08 CUDA Version: 12.3 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA RTX 4000 SFF Ada ... On | 00000000:01:00.0 On | Off |
| 30% 35C P8 9W / 70W | 434MiB / 20475MiB | 6% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
+---------------------------------------------------------------------------------------+