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

How to run CenterHMR on CPU? #20

Open
JANVI2411 opened this issue Dec 21, 2020 · 10 comments
Open

How to run CenterHMR on CPU? #20

JANVI2411 opened this issue Dec 21, 2020 · 10 comments

Comments

@JANVI2411
Copy link

JANVI2411 commented Dec 21, 2020

First of all thanks @Arthur151. I'm able to generate 3D meshes for my videos however I'm curious to know if we can also run this on CPU. it would be very kind of you if you can guide me on this.

@Arthur151
Copy link
Owner

Thanks for your interests!
I have just commit a version that support CPU.
You just have to change the GPU: 0 to GPU: -1 in config files (like src/configs/basic_test.yml or src/configs/basic_test_video.yml). Then the code should be run on CPU.

For details, please check the last two commits:
12f46d1
4004a0d

@JANVI2411
Copy link
Author

JANVI2411 commented Dec 21, 2020

Thanks for the quick reply @Arthur151
I tried changing GPUS: 0 to GPUS:-1 in src/configs/basic_test.yml but unfortunately it's throwing an error "TypeError: argument of type 'int' is not iterable" in this below line:

if '-1' not in self.gpu (file: src/core/base.py , line no: 41,55,189)

I changed this line to " if self.gpu!=-1 " then the above error is gone but got this error: "RuntimeError: No CUDA GPUs are available"

Sharing with you a screenshot : https://drive.google.com/file/d/1v9kjrOdI8nXWgjSIK21Zpp-qjUzrRYcm/view?usp=sharing

@Arthur151
Copy link
Owner

There are several things need to be noticed.

  1. I have just upload the commit. So you have to 'git pull' to drag the update. Or please simply reload the Colab and start over the entire process.
  2. There is a space between 'GPUS:' and '-1'. GPUS: -1 not GPUS:-1 .

@JANVI2411
Copy link
Author

JANVI2411 commented Dec 21, 2020

Yes. I already have taken care of both of these things. I setup the repository in totally new colab file and also put space between GPUS: and -1 (You can see that in the above screenshot , on right side I've kept open the yml file for your reference ).

Please take note of this : type of self.gpu is string not int that's why the if condition will be if self.gpu!='-1' not if self.gpu!=-1

Also, the model is running well upto here "finished build model" and after that the error is coming in file test.py and line no:20 : self.visualizer = Visualizer(model_type=self.model_type,resolution=self.vis_size, input_size=self.input_size,with_renderer=True)

Error: ValueError: Invalid device ID (0)

@Arthur151
Copy link
Owner

Arthur151 commented Dec 21, 2020

Sorry for the bug. I have just try the Colab. It turns out that the pyrender need GPU for visualization. So current code could run on CPU and save the 3D body mesh / SMPL parameter files. But it won't render the estimated 3D meshes back to 2D image due to the limitation of Pyrender package. In the future, I will try to replace the visualization module to achieve full CPU support.

The bug has been fixed. It passed the test on Colab (the last row).

@Arthur151
Copy link
Owner

Don't hesitate to let me know your problem.
Best.

@JANVI2411
Copy link
Author

Sure !
Thanks for your time and guidance.
Please keep the thread updated if anything pops up.

@Arthur151
Copy link
Owner

We have relase a new version with more funny things. Hope you enjoy it.

@Arthur151
Copy link
Owner

Training code has been released along with all evaluation.

@Arthur151
Copy link
Owner

@JANVI2411
BEV has been released for training, inference, and evaluation.

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

2 participants