gwthomas / Safe-MBPO

Code for the NeurIPS 2021 paper "Safe Reinforcement Learning by Imagining the Near Future"
MIT License
39 stars 8 forks source link

.env does not exist. #1

Open tingtingLiuLiu opened 2 years ago

tingtingLiuLiu commented 2 years ago

Hi ,I would like to ask a question. I run main.py and have a problem. What should I do? Looking forward to your reply, grateful !!! Traceback (most recent call last): File "F:/Safe-MBPO-main/Safe-MBPO-main/main.py", line 12, in from src.shared import get_env File "F:\Safe-MBPO-main\Safe-MBPO-main\src\shared.py", line 5, in from .sampling import SampleBuffer File "F:\Safe-MBPO-main\Safe-MBPO-main\src\sampling.py", line 6, in from .env.util import env_dims, isdiscrete, get_max_episode_steps ModuleNotFoundError: No module named 'src.env'

que10 commented 2 years ago

I have met the same question with you. I solved this by clicking the 'Force' in the third line and download the env folder in it. However, I also missed some files after doing that.

tingtingLiuLiu commented 2 years ago

Thanks ,I also solved this problem.But still encountered some problems. /home/ltt/anaconda3/envs/recovery/bin/python /home/ltt/Downloads/Safe-MBPO-main/main.py -c config/ant.json /home/ltt/anaconda3/envs/recovery/lib/python3.6/site-packages/gym/logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32 warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow')) Traceback (most recent call last): File "/home/ltt/Downloads/Safe-MBPO-main/main.py", line 12, in from src.shared import get_env File "/home/ltt/Downloads/Safe-MBPO-main/src/shared.py", line 5, in from .sampling import SampleBuffer File "/home/ltt/Downloads/Safe-MBPO-main/src/sampling.py", line 6, in from .env.util import env_dims, isdiscrete, get_max_episode_steps File "/home/ltt/Downloads/Safe-MBPO-main/src/env/util.py", line 9, in from .torch_wrapper import TorchWrapper File "/home/ltt/Downloads/Safe-MBPO-main/src/env/torch_wrapper.py", line 3, in from force.torch_util import torchify, numpyify File "/home/ltt/Downloads/Safe-MBPO-main/force/init.py", line 9, in MACHINE_VARIABLES = load() File "/home/ltt/Downloads/Safe-MBPO-main/force/init.py", line 6, in load assert path.is_file() AssertionError What does the machine.json file refer to? this is my‘s ’/home/ltt/Downloads/Safe-MBPO-main/force/machine.json

SJ9VRF commented 2 years ago

I have met the same question with you. I solved this by clicking the 'Force' in the third line and download the env folder in it. However, I also missed some files after doing that.

We need tasks files () from env file, which are not available in force/env. It's not a solution.

Following files are missing in force/env file:

from .env.hopper_no_bonus import HopperNoBonusEnv
from .env.cheetah_no_flip import CheetahNoFlipEnv
from .env.ant_no_bonus import AntNoBonusEnv
from .env.humanoid_no_bonus import HumanoidNoBonusEnv
SJ9VRF commented 2 years ago

The issue is solved. /env/ folder is added.

SJ9VRF commented 2 years ago

Hi ,I would like to ask a question. I run main.py and have a problem. What should I do? Looking forward to your reply, grateful !!! Traceback (most recent call last): File "F:/Safe-MBPO-main/Safe-MBPO-main/main.py", line 12, in from src.shared import get_env File "F:\Safe-MBPO-main\Safe-MBPO-main\src\shared.py", line 5, in from .sampling import SampleBuffer File "F:\Safe-MBPO-main\Safe-MBPO-main\src\sampling.py", line 6, in from .env.util import env_dims, isdiscrete, get_max_episode_steps ModuleNotFoundError: No module named 'src.env'

I have met the same question with you. I solved this by clicking the 'Force' in the third line and download the env folder in it. However, I also missed some files after doing that.

It's not the solution, force/env/ is a different folder