Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'ColoredRenderer' object has no attribute 'vbo_verts_face' #17

Closed
CheungBH opened this issue Jul 5, 2021 · 7 comments
Closed

Comments

@CheungBH
Copy link

CheungBH commented Jul 5, 2021

Hello. I met an error when I am running the demo.

Traceback (most recent call last):
File "./metro/tools/end2end_inference_bodymesh.py", line 318, in
main(args)
File "./metro/tools/end2end_inference_bodymesh.py", line 314, in main
run_inference(args, image_list, _metro_network, mesh_smpl, renderer, mesh_sampler)
File "./metro/tools/end2end_inference_bodymesh.py", line 90, in run_inference
att[-1][0].detach())
File "./metro/tools/end2end_inference_bodymesh.py", line 121, in visualize_mesh_and_attention
rend_img = visualize_reconstruction_and_att_local(img, 224, vertices_full, vertices, vertices_2d, cam, renderer, joints_2d, att, color='pink')
File "/home/user/Desktop/MeshTransformer/metro/utils/renderer.py", line 407, in visualize_reconstruction_and_att_local
focal_length=focal_length, body_color=color)
File "/home/user/Desktop/MeshTransformer/metro/utils/renderer.py", line 608, in render
return self.renderer.r
File "/home/user/anaconda3/envs/metro/lib/python3.7/site-packages/chumpy/ch.py", line 594, in r
self._call_on_changed()
File "/home/user/anaconda3/envs/metro/lib/python3.7/site-packages/chumpy/ch.py", line 589, in _call_on_changed
self.on_changed(self._dirty_vars)
File "/home/user/anaconda3/envs/metro/lib/python3.7/site-packages/opendr-0.73-py3.7.egg/opendr/renderer.py", line 1082, in on_changed
self.vbo_verts_face.set_array(np.array(self.verts_by_face).astype(np.float32))
AttributeError: 'ColoredRenderer' object has no attribute 'vbo_verts_face'

@CheungBH CheungBH changed the title Will training code be released? AttributeError: 'ColoredRenderer' object has no attribute 'vbo_verts_face' Jul 5, 2021
@CheungBH
Copy link
Author

CheungBH commented Jul 5, 2021

My opendr version is 0.73, ubuntu 18.04

@kevinlin311tw
Copy link
Member

Could you please try to upgrade opendr to 0.78? I use version 0.78 and it works.

@CheungBH
Copy link
Author

CheungBH commented Jul 7, 2021

Could you please try to upgrade opendr to 0.78? I use version 0.78 and it works.

i tried. but another error occurs.

(metro) user@user-System-Product-Name:~/Desktop/YOLOv3$ pip install opendr
Collecting opendr
Using cached opendr-0.78.tar.gz (581 kB)
Requirement already satisfied: Cython in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from opendr) (0.29.23)
Requirement already satisfied: chumpy>=0.58 in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from opendr) (0.70)
Requirement already satisfied: matplotlib in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from opendr) (3.4.2)
Requirement already satisfied: numpy>=1.8.1 in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from chumpy>=0.58->opendr) (1.20.2)
Requirement already satisfied: scipy>=0.13.0 in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from chumpy>=0.58->opendr) (1.4.1)
Requirement already satisfied: six>=1.11.0 in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from chumpy>=0.58->opendr) (1.16.0)
Requirement already satisfied: pillow>=6.2.0 in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from matplotlib->opendr) (8.2.0)
Requirement already satisfied: python-dateutil>=2.7 in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from matplotlib->opendr) (2.8.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from matplotlib->opendr) (1.3.1)
Requirement already satisfied: cycler>=0.10 in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from matplotlib->opendr) (0.10.0)
Requirement already satisfied: pyparsing>=2.2.1 in /home/user/anaconda3/envs/metro/lib/python3.7/site-packages (from matplotlib->opendr) (2.4.7)
Building wheels for collected packages: opendr
Building wheel for opendr (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/user/anaconda3/envs/metro/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u1cjb5op/opendr_f82152b85484442e8edb1e2f4c91208f/setup.py'"'"'; file='"'"'/tmp/pip-install-u1cjb5op/opendr_f82152b85484442e8edb1e2f4c91208f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-lmqz3bzq
cwd: /tmp/pip-install-u1cjb5op/opendr_f82152b85484442e8edb1e2f4c91208f/
Complete output (69 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/opendr
copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/version.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/renderer.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_geometry.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_sh.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/simple.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/camera.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/filters.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_depth_renderer.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/geometry.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/everything.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/util_tests.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/common.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/serialization.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/init.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/utils.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/cvwrap.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/lighting.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/topology.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/dummy.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_camera.py -> build/lib.linux-x86_64-3.7/opendr
creating build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/constants.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/autogen.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/fix_warnings.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/init.py -> build/lib.linux-x86_64-3.7/opendr/contexts
creating build/lib.linux-x86_64-3.7/opendr/test_dr
copying opendr/test_dr/init.py -> build/lib.linux-x86_64-3.7/opendr/test_dr
running build_ext
building 'opendr.contexts.ctx_mesa' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/opendr
creating build/temp.linux-x86_64-3.7/opendr/contexts
gcc -pthread -B /home/user/anaconda3/envs/metro/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -D__OSMESA
_=1 -Iopendr/contexts -I. -I/home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/home/user/anaconda3/envs/metro/include/python3.7m -c opendr/contexts/ctx_mesa.c -o build/temp.linux-x86_64-3.7/opendr/contexts/ctx_mesa.o -lstdc++
In file included from /home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944:0,
from /home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from opendr/contexts/ctx_mesa.c:662:
/home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with "
^~~~~~~
In file included from opendr/contexts/ctx_mesa.c:671:0:
opendr/contexts/OSMesa/include/GL/osmesa.h:258:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
typedef void (*OSMESAproc)();
^~~~~~~
opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
opendr/contexts/ctx_mesa.c:13149:49: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
^
In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085:0,
from opendr/contexts/gl_includes.h:10,
from opendr/contexts/ctx_mesa.c:670:
opendr/contexts/OSMesa/include/GL/glext.h:5794:21: note: expected ‘const GLchar ** {aka const char **}’ but argument is of type ‘char *
GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar
*string, const GLint *length);
^~~~~~~~~~~~~~
gcc -pthread -shared -B /home/user/anaconda3/envs/metro/compiler_compat -L/home/user/anaconda3/envs/metro/lib -Wl,-rpath=/home/user/anaconda3/envs/metro/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/opendr/contexts/ctx_mesa.o -Lopendr/contexts/OSMesa/lib -lOSMesa -lGL -lGLU -o build/lib.linux-x86_64-3.7/opendr/contexts/ctx_mesa.cpython-37m-x86_64-linux-gnu.so -lstdc++
/home/user/anaconda3/envs/metro/compiler_compat/ld: cannot find -lOSMesa
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

ERROR: Failed building wheel for opendr
Running setup.py clean for opendr
Failed to build opendr
Installing collected packages: opendr
Running setup.py install for opendr ... error
ERROR: Command errored out with exit status 1:
command: /home/user/anaconda3/envs/metro/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u1cjb5op/opendr_f82152b85484442e8edb1e2f4c91208f/setup.py'"'"'; file='"'"'/tmp/pip-install-u1cjb5op/opendr_f82152b85484442e8edb1e2f4c91208f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-v4ezhuhz/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/anaconda3/envs/metro/include/python3.7m/opendr
cwd: /tmp/pip-install-u1cjb5op/opendr_f82152b85484442e8edb1e2f4c91208f/
Complete output (69 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/opendr
copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/version.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/renderer.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_geometry.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_sh.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/simple.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/camera.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/filters.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_depth_renderer.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/geometry.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/everything.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/util_tests.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/common.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/serialization.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/init.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/utils.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/cvwrap.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/lighting.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/topology.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/dummy.py -> build/lib.linux-x86_64-3.7/opendr
copying opendr/test_camera.py -> build/lib.linux-x86_64-3.7/opendr
creating build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/constants.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/autogen.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/fix_warnings.py -> build/lib.linux-x86_64-3.7/opendr/contexts
copying opendr/contexts/init.py -> build/lib.linux-x86_64-3.7/opendr/contexts
creating build/lib.linux-x86_64-3.7/opendr/test_dr
copying opendr/test_dr/init.py -> build/lib.linux-x86_64-3.7/opendr/test_dr
running build_ext
building 'opendr.contexts.ctx_mesa' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/opendr
creating build/temp.linux-x86_64-3.7/opendr/contexts
gcc -pthread -B /home/user/anaconda3/envs/metro/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -D__OSMESA
_=1 -Iopendr/contexts -I. -I/home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/home/user/anaconda3/envs/metro/include/python3.7m -c opendr/contexts/ctx_mesa.c -o build/temp.linux-x86_64-3.7/opendr/contexts/ctx_mesa.o -lstdc++
In file included from /home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944:0,
from /home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from opendr/contexts/ctx_mesa.c:662:
/home/user/anaconda3/envs/metro/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with "
^~~~~~~
In file included from opendr/contexts/ctx_mesa.c:671:0:
opendr/contexts/OSMesa/include/GL/osmesa.h:258:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
typedef void (*OSMESAproc)();
^~~~~~~
opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
opendr/contexts/ctx_mesa.c:13149:49: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
^
In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085:0,
from opendr/contexts/gl_includes.h:10,
from opendr/contexts/ctx_mesa.c:670:
opendr/contexts/OSMesa/include/GL/glext.h:5794:21: note: expected ‘const GLchar ** {aka const char **}’ but argument is of type ‘char *
GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar
*string, const GLint *length);
^~~~~~~~~~~~~~
gcc -pthread -shared -B /home/user/anaconda3/envs/metro/compiler_compat -L/home/user/anaconda3/envs/metro/lib -Wl,-rpath=/home/user/anaconda3/envs/metro/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/opendr/contexts/ctx_mesa.o -Lopendr/contexts/OSMesa/lib -lOSMesa -lGL -lGLU -o build/lib.linux-x86_64-3.7/opendr/contexts/ctx_mesa.cpython-37m-x86_64-linux-gnu.so -lstdc++
/home/user/anaconda3/envs/metro/compiler_compat/ld: cannot find -lOSMesa
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/anaconda3/envs/metro/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u1cjb5op/opendr_f82152b85484442e8edb1e2f4c91208f/setup.py'"'"'; file='"'"'/tmp/pip-install-u1cjb5op/opendr_f82152b85484442e8edb1e2f4c91208f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-v4ezhuhz/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/anaconda3/envs/metro/include/python3.7m/opendr Check the logs for full command output.

Do you have any solutions for it?

@kevinlin311tw
Copy link
Member

kevinlin311tw commented Jul 7, 2021

For opendr installation, there are different possible solutions.

You could try the following one, which works for many folks:

pip install git+https://gitlab.eecs.umich.edu/ngv-python-modules/opendr.git

or you could try the following one, which I found useful on my machine:

apt-get update
apt-get install  build-essential libgl1-mesa-dev  libglu1-mesa-dev freeglut3-dev 
apt-get install libosmesa6-dev
pip install opendr

The first solution can be found in the previous issue here
The second solution is inspired by the discussions here

@CheungBH
Copy link
Author

CheungBH commented Jul 8, 2021

Thanks. It works.

@CheungBH CheungBH closed this as completed Jul 8, 2021
@lucasjinreal
Copy link

@kevinlin311tw the first solution is not work any more, second one also not work for windows

@Morehab
Copy link

Morehab commented Jul 22, 2023

@kevinlin311tw the first solution is not work any more, second one also not work for windows

Hi, did you solve this? I tried several versions and kept getting this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants