VIBE
VIBE copied to clipboard
dockerize VIBE [WIP]
Thanks a lot for your PR @x0rzkov! Image is created successfully using it. However, when I try to run the demo using python demo.py --vid_file sample_video.mp4 --output_folder output/
, it gives:
Traceback (most recent call last):
File "demo.py", line 20, in <module>
import cv2
File "/opt/conda/lib/python3.7/site-packages/cv2/__init__.py", line 3, in <module>
from .cv2 import *
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
Could you fix this issue?
It is missing "glib-dev"
can you provide the link to sample_video.mp4 to download ?
It will be downloaded if you run sh prepare_data.sh
. Here is the link: https://github.com/mkocabas/VIBE/blob/bf5cfb0c437c060b2ade3d56036ed0148cf96587/prepare_data.sh#L3
You can reproduce the same error by trying to import cv2
inside the image.
@x0rzkov Now, EGL is missing:
bash-5.0# python demo.py --vid_file sample_video.mp4 --output_folder output/
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/egl.py", line 70, in EGL
mode=ctypes.RTLD_GLOBAL
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/ctypesloader.py", line 45, in loadLibrary
return dllType( name, mode )
File "/opt/conda/lib/python3.7/ctypes/__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: ('EGL: cannot open shared object file: No such file or directory', 'EGL', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "demo.py", line 33, in <module>
from lib.utils.renderer import Renderer
File "/opt/vibe/lib/utils/renderer.py", line 19, in <module>
import pyrender
File "/opt/conda/lib/python3.7/site-packages/pyrender/__init__.py", line 3, in <module>
from .light import Light, PointLight, DirectionalLight, SpotLight
File "/opt/conda/lib/python3.7/site-packages/pyrender/light.py", line 11, in <module>
from .texture import Texture
File "/opt/conda/lib/python3.7/site-packages/pyrender/texture.py", line 8, in <module>
from OpenGL.GL import *
File "/opt/conda/lib/python3.7/site-packages/OpenGL/GL/__init__.py", line 3, in <module>
from OpenGL import error as _error
File "/opt/conda/lib/python3.7/site-packages/OpenGL/error.py", line 12, in <module>
from OpenGL import platform, _configflags
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/__init__.py", line 35, in <module>
_load()
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/__init__.py", line 32, in _load
plugin.install(globals())
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 92, in install
namespace[ name ] = getattr(self,name,None)
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/egl.py", line 93, in GetCurrentContext
return self.EGL.eglGetCurrentContext
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 14, in __get__
value = self.fget( obj )
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/egl.py", line 73, in EGL
raise ImportError("Unable to load EGL library", *err.args)
ImportError: ('Unable to load EGL library', 'EGL: cannot open shared object file: No such file or directory', 'EGL', None)
I am modifying the Dockerfile, you need to install https://github.com/NVIDIA/libglvnd for EGL, isn't it ?
I am not sure, according to this notebook installing pyrender should be enough. You may give it a try.
Can you test the latest version ? it is fine on my side
During rendering final video, I got this error:
Traceback (most recent call last):
File "demo.py", line 347, in <module>
main(args)
File "demo.py", line 250, in main
renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe)
File "/opt/vibe/lib/utils/renderer.py", line 60, in __init__
point_size=1.0
File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in __init__
self._create()
File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 134, in _create
self._platform.init_context()
File "/opt/conda/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 177, in init_context
assert eglInitialize(self._egl_display, major, minor)
File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__
return self( *args, **named )
File "/opt/conda/lib/python3.7/site-packages/OpenGL/error.py", line 232, in glCheckError
baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
err = 12296,
baseOperation = eglInitialize,
cArguments = (
<OpenGL._opaque.EGLDisplay_pointer object at 0x7f5c89c2d050>,
c_long(0),
c_long(0),
),
result = 0
)
on my side, I have
ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 724, in _try_get_data
data = self._data_queue.get(timeout=timeout)
File "/opt/conda/lib/python3.7/multiprocessing/queues.py", line 104, in get
if not self._poll(timeout):
File "/opt/conda/lib/python3.7/multiprocessing/connection.py", line 257, in poll
return self._poll(timeout)
File "/opt/conda/lib/python3.7/multiprocessing/connection.py", line 414, in _poll
r = wait([self], timeout)
File "/opt/conda/lib/python3.7/multiprocessing/connection.py", line 920, in wait
ready = selector.select(timeout)
File "/opt/conda/lib/python3.7/selectors.py", line 415, in select
fd_event_list = self._selector.poll(timeout)
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/_utils/signal_handling.py", line 66, in handler
_error_if_any_worker_fails()
RuntimeError: DataLoader worker (pid 95) is killed by signal: Bus error. It is possible that dataloader's workers are out of shared memory. Please try to raise your shared memory limit.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "demo.py", line 347, in <module>
main(args)
File "demo.py", line 94, in main
tracking_results = mot(image_folder)
File "/opt/conda/lib/python3.7/site-packages/multi_person_tracker/mpt.py", line 194, in __call__
trackers = self.run_tracker(dataloader)
File "/opt/conda/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 49, in decorate_no_grad
return func(*args, **kwargs)
File "/opt/conda/lib/python3.7/site-packages/multi_person_tracker/mpt.py", line 75, in run_tracker
for batch in tqdm(dataloader):
File "/opt/conda/lib/python3.7/site-packages/tqdm/std.py", line 1081, in __iter__
for obj in iterable:
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 804, in __next__
idx, data = self._get_data()
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 771, in _get_data
success, data = self._try_get_data()
File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 737, in _try_get_data
raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.format(pids_str))
RuntimeError: DataLoader worker (pid(s) 95, 96, 97, 98, 99, 100, 101) exited unexpectedly
I will try with ubuntu... wanted to make a slim image ^^
Sorry I closed it by my mistake. You can avoid memory error by running sudo docker run -it --shm-size 8G vibe
I have a macbook air with 4gb ^^
Let me know if the new container works better on your side.
It is still giving this OpenGL error:
Traceback (most recent call last):
File "demo.py", line 347, in <module>
main(args)
File "demo.py", line 250, in main
renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe)
File "/opt/vibe/lib/utils/renderer.py", line 60, in __init__
point_size=1.0
File "/usr/local/lib/python3.7/dist-packages/pyrender/offscreen.py", line 31, in __init__
self._create()
File "/usr/local/lib/python3.7/dist-packages/pyrender/offscreen.py", line 134, in _create
self._platform.init_context()
File "/usr/local/lib/python3.7/dist-packages/pyrender/platforms/egl.py", line 188, in init_context
EGL_NO_CONTEXT, context_attributes
File "/usr/local/lib/python3.7/dist-packages/OpenGL/platform/baseplatform.py", line 402, in __call__
return self( *args, **named )
File "/usr/local/lib/python3.7/dist-packages/OpenGL/error.py", line 232, in glCheckError
baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
err = 12297,
baseOperation = eglCreateContext,
cArguments = (
<OpenGL._opaque.EGLDisplay_pointer object at 0x7ff7adc099e0>,
<OpenGL._opaque.EGLConfig_pointer object at 0x7ff7adc09950>,
<OpenGL._opaque.EGLContext_pointer object at 0x7ff7adc7e950>,
<OpenGL.arrays.lists.c_int_Array_7 object at 0x7ff6e8306560>,
),
result = <OpenGL._opaque.EGLContext_pointer object at 0x7ff6e8219320>
)
One another issue, we need to use nvidia-docker
to be able run it on GPU machines. If you can do it, it would be perfect. Otherwise, I can do it when I have time, and commit to this PR.
I tried to prepare you as much as possible but I cannot test it on my machine host config. ^^ merge it or close it, you are the only judge :-)
@x0rzkov I am still getting errors with the current one, I will commit and merge this PR once I complete it. Thanks for your efforts!
let me know
During rendering final video, I got this error:
Traceback (most recent call last): File "demo.py", line 347, in <module> main(args) File "demo.py", line 250, in main renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe) File "/opt/vibe/lib/utils/renderer.py", line 60, in __init__ point_size=1.0 File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in __init__ self._create() File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 134, in _create self._platform.init_context() File "/opt/conda/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 177, in init_context assert eglInitialize(self._egl_display, major, minor) File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__ return self( *args, **named ) File "/opt/conda/lib/python3.7/site-packages/OpenGL/error.py", line 232, in glCheckError baseOperation = baseOperation, OpenGL.error.GLError: GLError( err = 12296, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f5c89c2d050>, c_long(0), c_long(0), ), result = 0 )
Hi @mkocabas, I've got the same issue trying to render it on my GPU machine (but without any nvidia EGL dockers). May be you know what it concerns or give me a path how to fix this issue?
Hi @kallivad this PR is a work in progress. It is not finished and tested. Please use pip
or conda
to install the requirements.
@mkocabas @x0rzkov Hi guys, the demo code works on this docker image. https://hub.docker.com/r/nvidia/cudagl Cheers.
@x0rzkov - thanks for your efforts - running docker via linux in wsl2
I had to add version: "3.2" at the top of docker-compose.yml to get it to build
when I run python3 demo.py --vid_file sample_video.mp4 --output_folder output/ --display
I'm getting this error:
Traceback (most recent call last):
File "demo.py", line 38, in
Any ideas? Thanks.
During rendering final video, I got this error:
Traceback (most recent call last):
File "demo.py", line 383, in
@x0rzkov - thanks for your efforts - running docker via linux in wsl2 I had to add version: "3.2" at the top of docker-compose.yml to get it to build when I run python3 demo.py --vid_file sample_video.mp4 --output_folder output/ --display I'm getting this error: Traceback (most recent call last): File "demo.py", line 38, in from lib.utils.demo_utils import ( File "/opt/vibe/lib/utils/demo_utils.py", line 25, in from pytube import YouTube File "/usr/local/lib/python3.7/dist-packages/pytube/init.py", line 16, in from pytube.streams import Stream File "/usr/local/lib/python3.7/dist-packages/pytube/streams.py", line 17, in from pytube import extract File "/usr/local/lib/python3.7/dist-packages/pytube/extract.py", line 7, in from pytube.compat import quote ImportError: cannot import name 'quote' from 'pytube.compat' (/usr/local/lib/python3.7/dist-packages/pytube/compat.py)
Any ideas? Thanks.
just use : pip install pytube3
Made own GPU ready container for VIBE https://github.com/Inokenty90/vibedocker. Demo and fbx_output are working.
Hi, I'm getting the same OpenGL 12297 error.
My current dockerfile is this:
FROM nvidia/cudagl:10.1-devel-ubuntu18.04
COPY . /poseestimator
WORKDIR /poseestimator
RUN ln -sf /bin/bash /bin/sh
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y python3.7 python3-distutils python3-apt
RUN ln -sf /usr/bin/python3.7 /usr/bin/python3 && \
ln -sf /usr/bin/python3.7m /usr/bin/python3m && \
ln -sf /usr/bin/python3 /usr/bin/python
RUN apt-get install -y curl
RUN pushd /tmp && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3 get-pip.py --force-reinstall && \
popd
RUN apt-get install -y git
RUN apt-get install -y ffmpeg
RUN apt-get install -y wget
RUN apt-get install -y libsm6 libxext6 libxrender-dev
RUN apt-get install -y freeglut3-dev
RUN apt-get install -y libosmesa6-dev freeglut3-dev
RUN apt-get install -y libglfw3-dev libgles2-mesa-dev
RUN pip install numpy==1.17.5 torch==1.4.0 torchvision==0.5.0
RUN pip install git+https://github.com/giacaglia/pytube.git --upgrade
RUN pip install -r VIBE/requirements.txt
RUN apt-get install -y unzip
RUN scripts/prepare_data.sh && \
The output running the demo:
# python demo.py --vid_file sample_video.mp4 --output_folder output/
Running "ffmpeg -i sample_video.mp4 -f image2 -v error /tmp/sample_video_mp4/%06d.png"
Images saved to "/tmp/sample_video_mp4"
Input video number of frames 300
Running Multi-Person-Tracker
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 25/25 [00:13<00:00, 2.01it/s]
Finished. Detection + Tracking FPS 21.64
WARNING: You are using a SMPL model, with only 10 shape coefficients.
WARNING: You are using a SMPL model, with only 10 shape coefficients.
=> loaded pretrained model from 'data/vibe_data/spin_model_checkpoint.pth.tar'
Performance of pretrained model on 3DPW: 56.56075477600098
Loaded pretrained weights from "data/vibe_data/vibe_model_wo_3dpw.pth.tar"
Running VIBE on each tracklet...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.30s/it]
VIBE FPS: 26.55
Total time spent: 31.96 seconds (including model loading time).
Total FPS (including model loading time): 9.39.
Saving output results to "output/sample_video/vibe_output.pkl".
WARNING: You are using a SMPL model, with only 10 shape coefficients.
Traceback (most recent call last):
File "demo.py", line 495, in <module>
main(args)
File "demo.py", line 303, in main
wireframe=args.wireframe,
File "/poseestimator/VIBE/lib/utils/renderer.py", line 60, in __init__
point_size=1.0
File "/usr/local/lib/python3.7/dist-packages/pyrender/offscreen.py", line 31, in __init__
self._create()
File "/usr/local/lib/python3.7/dist-packages/pyrender/offscreen.py", line 134, in _create
self._platform.init_context()
File "/usr/local/lib/python3.7/dist-packages/pyrender/platforms/egl.py", line 188, in init_context
EGL_NO_CONTEXT, context_attributes
File "/usr/local/lib/python3.7/dist-packages/OpenGL/platform/baseplatform.py", line 402, in __call__
return self( *args, **named )
File "/usr/local/lib/python3.7/dist-packages/OpenGL/error.py", line 232, in glCheckError
baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
err = 12297,
baseOperation = eglCreateContext,
cArguments = (
<OpenGL._opaque.EGLDisplay_pointer object at 0x7f18c530d7a0>,
<OpenGL._opaque.EGLConfig_pointer object at 0x7f18c530d830>,
<OpenGL._opaque.EGLContext_pointer object at 0x7f18c5d7f290>,
<OpenGL.arrays.lists.c_int_Array_7 object at 0x7f18c53290e0>,
),
result = <OpenGL._opaque.EGLContext_pointer object at 0x7f18c5308050>
)
Hello, I fixed the opengl error by setting the MESA_GL_VERSION as follows:
MESA_GL_VERSION_OVERRIDE=4.1 python sample_video.mp4 --vid_file test.mp4 --output_folder output/
For more on the issue check: https://github.com/mmatl/pyrender/issues/86
During rendering final video, I got this error:
Traceback (most recent call last): File "demo.py", line 347, in <module> main(args) File "demo.py", line 250, in main renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe) File "/opt/vibe/lib/utils/renderer.py", line 60, in __init__ point_size=1.0 File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in __init__ self._create() File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 134, in _create self._platform.init_context() File "/opt/conda/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 177, in init_context assert eglInitialize(self._egl_display, major, minor) File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__ return self( *args, **named ) File "/opt/conda/lib/python3.7/site-packages/OpenGL/error.py", line 232, in glCheckError baseOperation = baseOperation, OpenGL.error.GLError: GLError( err = 12296, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f5c89c2d050>, c_long(0), c_long(0), ), result = 0 )
I also met this problem. I'd like to ask about the solution.
During rendering final video, I got this error:
Traceback (most recent call last): File "demo.py", line 347, in <module> main(args) File "demo.py", line 250, in main renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe) File "/opt/vibe/lib/utils/renderer.py", line 60, in __init__ point_size=1.0 File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in __init__ self._create() File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 134, in _create self._platform.init_context() File "/opt/conda/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 177, in init_context assert eglInitialize(self._egl_display, major, minor) File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__ return self( *args, **named ) File "/opt/conda/lib/python3.7/site-packages/OpenGL/error.py", line 232, in glCheckError baseOperation = baseOperation, OpenGL.error.GLError: GLError( err = 12296, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f5c89c2d050>, c_long(0), c_long(0), ), result = 0 )
@mkocabas ,hello, i want to know how to solve this problem. could you help me, please
During rendering final video, I got this error:
Traceback (most recent call last): File "demo.py", line 347, in <module> main(args) File "demo.py", line 250, in main renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe) File "/opt/vibe/lib/utils/renderer.py", line 60, in __init__ point_size=1.0 File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in __init__ self._create() File "/opt/conda/lib/python3.7/site-packages/pyrender/offscreen.py", line 134, in _create self._platform.init_context() File "/opt/conda/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 177, in init_context assert eglInitialize(self._egl_display, major, minor) File "/opt/conda/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__ return self( *args, **named ) File "/opt/conda/lib/python3.7/site-packages/OpenGL/error.py", line 232, in glCheckError baseOperation = baseOperation, OpenGL.error.GLError: GLError( err = 12296, baseOperation = eglInitialize, cArguments = ( <OpenGL._opaque.EGLDisplay_pointer object at 0x7f5c89c2d050>, c_long(0), c_long(0), ), result = 0 )
I also met this problem. I'd like to ask about the solution. i also encountered this problem. did you solve it syccessfully?