Skip to content

Commit

Permalink
Enhance/code-scanning-alerts (#115)
Browse files Browse the repository at this point in the history
* Enhance/code-scanning-alerts

* Remove rendering

* Remove unused import
  • Loading branch information
dongminlee94 committed Dec 30, 2022
1 parent a18a3e9 commit 92b6688
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
13 changes: 8 additions & 5 deletions scripts/download-torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@


def main() -> None:
cmd = "pip install torch==1.9.1"

if sys.platform == "win32" or sys.platform == "linux":
if GPUtil.getAvailable():
cli = "pip install torch==1.9.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html"
cmd += "+cu111 -f https://download.pytorch.org/whl/torch_stable.html"
else:
cli = "pip install torch==1.9.1+cpu -f https://download.pytorch.org/whl/torch_stable.html"
cmd += "+cpu -f https://download.pytorch.org/whl/torch_stable.html"
elif sys.platform == "darwin":
cli = "pip install torch==1.9.1 -f https://download.pytorch.org/whl/torch_stable.html"
print(cli)
os.system(cli)
cmd += " -f https://download.pytorch.org/whl/torch_stable.html"

print(cmd)
os.system(cmd)


if __name__ == "__main__":
Expand Down
11 changes: 0 additions & 11 deletions src/meta_rl/envs/half_cheetah.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import List, Union

import numpy as np
from gym import utils
from gym.envs.mujoco import HalfCheetahEnv as HalfCheetahEnv_
Expand Down Expand Up @@ -30,12 +28,3 @@ def viewer_setup(self) -> None:
self.viewer.cam.fixedcamid = camera_id
self.viewer.cam.distance = self.model.stat.extent * 0.35
self.viewer._hide_overlay = True

def render(self, mode: str = "human") -> Union[List[float], None]:
if mode == "rgb_array":
self._get_viewer().render()
width, height = 500, 500
data = self._get_viewer().read_pixels(width, height, depth=False)
return data
elif mode == "human":
self._get_viewer().render()

0 comments on commit 92b6688

Please sign in to comment.