Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Using cpu for testing? #1

Closed
watchernyu opened this issue Nov 24, 2021 · 2 comments
Closed

Using cpu for testing? #1

watchernyu opened this issue Nov 24, 2021 · 2 comments

Comments

@watchernyu
Copy link

First of all thank you very much for presenting this nice paper and open source the code!

I'm wondering if it's possible to use cpu instead of gpu to do some testing on my local machine (which unfortunately does not have a cuda gpu)? I tried to modify the code a bit and run (I have the demo files under ../demo)

python convertDemos.py --env_name hammer-v0 --encoder_type resnet34 -c top -d ../demo/hammer-v0_demos.pickle

Then it gives me the following error,
ERROR: GLEW initalization error: Missing GL version
which occurs at the rendering line in multicam.py:
img = self._env.env.sim.render(width=self.width, height=self.height, mode='offscreen', camera_name=cam)

Is there an easy way to ask mujoco to do cpu rendering here (software rendering)? Thanks a lot for the help!

@ShahRutav
Copy link

ShahRutav commented Nov 26, 2021

Hi @watchernyu,

The error is related to installation of mujoco_py. Please check this thread, might be helpful. I believe, this error is due to some missing mujoco_py dependency.

Regarding running the codebase on CPU, I will try to push an update soon, meanwhile these pointers might be helpful:

  1. You can simply add an if-else statement here which will load the image and model on cpu/gpu.
  2. Similarly, you can adjust the rendering device_id of image here.

@watchernyu
Copy link
Author

Thanks a lot for your response, that is very helpful! I will close the issue now.

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

No branches or pull requests

2 participants