mkocabas / VIBE

Official implementation of CVPR2020 paper "VIBE: Video Inference for Human Body Pose and Shape Estimation"
https://arxiv.org/abs/1912.05656
Other
2.85k stars 551 forks source link

[BUG]egl:ValueError: Invalid device ID (0) #267

Open lllllialois opened 1 year ago

lllllialois commented 1 year ago

I met this bug Traceback (most recent call last): File "/opt/data/private/VIBE-master/demo.py", line 416, in main(args) File "/opt/data/private/VIBE-master/demo.py", line 278, in main renderer = Renderer(resolution=(orig_width, orig_height), orig_img=True, wireframe=args.wireframe) File "/opt/data/private/VIBE-master/lib/utils/renderer.py", line 60, in init point_size=1.0 File "/opt/tools/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/offscreen.py", line 31, in init self._create() File "/opt/tools/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/offscreen.py", line 122, in _create egl_device = egl.get_device_by_index(device_id) File "/opt/tools/anaconda3/envs/vibe-env/lib/python3.7/site-packages/pyrender/platforms/egl.py", line 83, in get_device_by_index raise ValueError('Invalid device ID ({})'.format(device_id, len(devices))) ValueError: Invalid device ID (0)

lllllialois commented 1 year ago

ok, It seems that there has some elusive bug with the egl. According to the docs of pyrender, we can use osmesa instead of egl. image change os.environ['PYOPENGL_PLATFORM'] = 'egl' into os.environ['PYOPENGL_PLATFORM'] = 'osmesa' to use osmesa. see the docs to learn how to install osmesa.

sudo apt update
sudo apt-get install llvm-6.0 freeglut3 freeglut3-dev
sudo apt --fix-broken install
sudo wget https://github.com/mmatl/travis_debs/raw/master/xenial/mesa_18.3.3-0.deb
sudo dpkg -i ./mesa_18.3.3-0.deb || true
sudo apt install -f

or sudo wget --no-check-certificate https://github.com/mmatl/travis_debs/raw/master/xenial/mesa_18.3.3-0.deb

then

git clone https://github.com/mmatl/pyopengl.git
pip install ./pyopengl

if get this error:

output_img = rgb[:, :, :-1] * valid_mask + (1 - valid_mask) * img
ValueError: operands could not be broadcast together with shapes (1080,1920,2) (1080,1920,3)

change output_img = rgb[:, :, :-1] * valid_mask + (1 - valid_mask) * img into output_img = rgb[:, :, :] * valid_mask + (1 - valid_mask) * img or output_img = rgb * valid_mask + (1 - valid_mask) * img