Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] return self._finalCall( *args, **named ) TypeError: 'NoneType' object is not callable During handling of the above exception, another exception occurred: TypeError: startswith first arg must be bytes or a tuple of bytes, not str #61

Closed
Frank-Dz opened this issue Apr 17, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@Frank-Dz
Copy link

Frank-Dz commented Apr 17, 2020

If you have problems running our code, please include;

(venv) frank@frank-Blade:~/PycharmProjects/VIBE$ python demo.py --vid_file sample_video.mp4 --output_folder output/ --display
  1. Ubuntu16.04
  2. python3.7(virtualenv)
  3. pytorch=1.4.0, torchvision=0.5.0, (with cuda=10.0, and cuda available is true)
  4. the stack trace of the error:
(venv) frank@frank-Blade:~/PycharmProjects/VIBE$ python demo.py --vid_file sample_video.mp4 --output_folder output/ --display
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 301
Running Multi-Person-Tracker
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 26/26 [00:10<00:00,  2.46it/s]
Finished. Detection + Tracking FPS 28.33
Displaying results..
=> 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:04<00:00,  4.40s/it]
VIBE FPS: 68.31
Total time spent: 26.75 seconds (including model loading time).
Total FPS (including model loading time): 11.25.
Saving output results to "output/sample_video/vibe_output.pkl".
Rendering output video, writing frames to /tmp/sample_video_mp4_output
  0%|                                                                                                                                                                                                     | 0/301 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/latebind.py", line 41, in __call__
    return self._finalCall( *args, **named )
TypeError: 'NoneType' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "demo.py", line 383, in <module>
    main(args)
  File "demo.py", line 298, in main
    mesh_filename=mesh_filename,
  File "/home/frank/PycharmProjects/VIBE/lib/utils/renderer.py", line 118, in render
    rgb, _ = self.renderer.render(self.scene, flags=render_flags)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/offscreen.py", line 99, in render
    return self._renderer.render(scene, flags)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/renderer.py", line 121, in render
    self._update_context(scene, flags)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/renderer.py", line 709, in _update_context
    p._add_to_context()
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/primitive.py", line 324, in _add_to_context
    self._vaid = glGenVertexArrays(1)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/latebind.py", line 45, in __call__
    return self._finalCall( *args, **named )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/wrapper.py", line 657, in wrapperCall
    result = wrappedOperation( *cArguments )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 401, in __call__
    if self.load():
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 390, in load
    error_checker = self.error_checker,
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 148, in constructFunction
    if (not is_core) and not self.checkExtension( extension ):
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 270, in checkExtension
    result = extensions.ExtensionQuerier.hasExtension( name )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/extensions.py", line 98, in hasExtension
    result = registered( specifier )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/extensions.py", line 105, in __call__
    if not specifier.startswith( self.prefix ):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Anyone can help?

Thanks in advance!

Update:
After ran the code pip install PyOpenGL PyOpenGL_accelerate
The error became:

(venv) frank@frank-Blade:~/PycharmProjects/VIBE$ python demo.py --vid_file sample_video.mp4 --output_folder output/ --display
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 301
Running Multi-Person-Tracker
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 26/26 [00:07<00:00,  3.28it/s]
Finished. Detection + Tracking FPS 37.99
Displaying results..
=> 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:04<00:00,  4.68s/it]
VIBE FPS: 64.21
Total time spent: 27.92 seconds (including model loading time).
Total FPS (including model loading time): 10.78.
Saving output results to "output/sample_video/vibe_output.pkl".
Rendering output video, writing frames to /tmp/sample_video_mp4_output
  0%|                                                                                                                                                                                                     | 0/301 [00:00<?, ?it/s]None
------------------------------

Traceback (most recent call last):
  File "demo.py", line 384, in <module>
    main(args)
  File "demo.py", line 299, in main
    mesh_filename=mesh_filename,
  File "/home/frank/PycharmProjects/VIBE/lib/utils/renderer.py", line 118, in render
    rgb, _ = self.renderer.render(self.scene, flags=render_flags)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/offscreen.py", line 99, in render
    return self._renderer.render(scene, flags)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/renderer.py", line 121, in render
    self._update_context(scene, flags)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/renderer.py", line 709, in _update_context
    p._add_to_context()
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/primitive.py", line 324, in _add_to_context
    self._vaid = glGenVertexArrays(1)
  File "src/latebind.pyx", line 39, in OpenGL_accelerate.latebind.LateBind.__call__
  File "src/wrapper.pyx", line 314, in OpenGL_accelerate.wrapper.Wrapper.__call__
  File "src/wrapper.pyx", line 311, in OpenGL_accelerate.wrapper.Wrapper.__call__
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 401, in __call__
    if self.load():
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 390, in load
    error_checker = self.error_checker,
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 148, in constructFunction
    if (not is_core) and not self.checkExtension( extension ):
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 270, in checkExtension
    result = extensions.ExtensionQuerier.hasExtension( name )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/extensions.py", line 98, in hasExtension
    result = registered( specifier )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/extensions.py", line 105, in __call__
    if not specifier.startswith( self.prefix ):
TypeError: ('startswith first arg must be bytes or a tuple of bytes, not str', (1, array([0], dtype=uint32)))
@Frank-Dz Frank-Dz added the bug Something isn't working label Apr 17, 2020
@Frank-Dz
Copy link
Author

And if I disabled --display and try to get the .OBJ files.

python demo.py --vid_file sample_video.mp4 --output_folder output/  --save_obj

We got the following errors:

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 301
Running Multi-Person-Tracker
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 26/26 [00:07<00:00,  3.29it/s]
Finished. Detection + Tracking FPS 38.11
=> 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:04<00:00,  4.31s/it]
VIBE FPS: 69.80
Total time spent: 18.16 seconds (including model loading time).
Total FPS (including model loading time): 16.57.
Saving output results to "output/sample_video/vibe_output.pkl".
Rendering output video, writing frames to /tmp/sample_video_mp4_output
  0%|                                                                                                                                                                                                     | 0/301 [00:00<?, ?it/s]output/sample_video/meshes/0001/000000.obj
------------------------------

Traceback (most recent call last):
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/latebind.py", line 41, in __call__
    return self._finalCall( *args, **named )
TypeError: 'NoneType' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "demo.py", line 384, in <module>
    main(args)
  File "demo.py", line 299, in main
    mesh_filename=mesh_filename,
  File "/home/frank/PycharmProjects/VIBE/lib/utils/renderer.py", line 118, in render
    rgb, _ = self.renderer.render(self.scene, flags=render_flags)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/offscreen.py", line 99, in render
    return self._renderer.render(scene, flags)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/renderer.py", line 121, in render
    self._update_context(scene, flags)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/renderer.py", line 709, in _update_context
    p._add_to_context()
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/pyrender/primitive.py", line 324, in _add_to_context
    self._vaid = glGenVertexArrays(1)
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/latebind.py", line 45, in __call__
    return self._finalCall( *args, **named )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/wrapper.py", line 657, in wrapperCall
    result = wrappedOperation( *cArguments )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 401, in __call__
    if self.load():
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 390, in load
    error_checker = self.error_checker,
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 148, in constructFunction
    if (not is_core) and not self.checkExtension( extension ):
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/platform/baseplatform.py", line 270, in checkExtension
    result = extensions.ExtensionQuerier.hasExtension( name )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/extensions.py", line 98, in hasExtension
    result = registered( specifier )
  File "/home/frank/PycharmProjects/VIBE/venv/lib/python3.7/site-packages/OpenGL/extensions.py", line 105, in __call__
    if not specifier.startswith( self.prefix ):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

We can only got one .OBJ (For this single mesh, the result is right.)
image

@ahsan3803
Copy link

ahsan3803 commented Apr 17, 2020

It's not bug in VIBE. It's pyrender problem. Pyrender 0.1.36 and PyOpenGL 3.1.0 are working fine in my case. You can check Pyrender Offical repo for detail information.
In VIBE repo there are some these issues #9 #27 #32 and #47 related to pyrender, these problems are due to Nvidia Driver, means Nvidia Driver is not properly installed and missing EGL or other graphics files which OpenGL used. You should double check about it that your Nvidia Driver is installed properly?
By the way your issue is quite similar with #10. I hope you can solve it by mentioned solution in that issue.

@Frank-Dz
Copy link
Author

It's not bug in VIBE. It's pyrender problem. Pyrender 0.1.36 and PyOpenGL 3.1.0 are working fine in my case. You can check Pyrender Offical repo for detail information.
In VIBE repo there are some these issues #9 #27 #32 and #47 related to pyrender, these problems are due to Nvidia Driver, means Nvidia Driver is not properly installed and missing EGL or other graphics files which OpenGL used. You should double check about it that your Nvidia Driver is installed properly?
By the way your issue is quite similar with #10. I hope you can solve it by mentioned solution in that issue.

Thanks!
Successfully fixed it according to mcfletch/pyopengl#27

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants