IBM / rl-testbed-for-energyplus

Reinforcement Learning Testbed for Power Consumption Optimization using EnergyPlus
MIT License
191 stars 77 forks source link

gym.error.UnregisteredEnv: No registered env with id: EnergyPlus-v0 #63

Closed flag2freefish closed 2 years ago

flag2freefish commented 3 years ago

after running time python3 -m baselines_energyplus.trpo_mpi.run_energyplus --num-timesteps 1000000000 with EnergyPlus-9-3-0 in Ubuntu18.04 on Windows 10

WARNING:tensorflow:From /home/yhl/EP/rl-testbed-for-energyplus/src/baselines/baselines/common/tf_util.py:63: The name tf.ConfigProto is deprecated. Please use tf.compat.v1.ConfigProto instead.

WARNING:tensorflow:From /home/yhl/EP/rl-testbed-for-energyplus/src/baselines/baselines/common/tf_util.py:72: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2021-09-01 16:32:43.294147: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2021-09-01 16:32:43.297234: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2304005000 Hz 2021-09-01 16:32:43.297420: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x4426b30 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2021-09-01 16:32:43.297448: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version train: init logger with dir=/home/yhl/eplog/openai-2021-09-01-16-32-43-298104 Logging to /home/yhl/eplog/openai-2021-09-01-16-32-43-298104 Traceback (most recent call last): File "/home/yhl/.local/lib/python3.6/site-packages/gym/envs/registration.py", line 132, in spec return self.env_specs[id] KeyError: 'EnergyPlus-v0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/yhl/EP/rl-testbed-for-energyplus/baselines_energyplus/trpo_mpi/run_energyplus.py", line 56, in main() File "/home/yhl/EP/rl-testbed-for-energyplus/baselines_energyplus/trpo_mpi/run_energyplus.py", line 53, in main train(args.env, num_timesteps=args.num_timesteps, seed=args.seed) File "/home/yhl/EP/rl-testbed-for-energyplus/baselines_energyplus/trpo_mpi/run_energyplus.py", line 41, in train env = make_energyplus_env(env_id, workerseed) File "/home/yhl/EP/rl-testbed-for-energyplus/baselines_energyplus/common/energyplus_util.py", line 19, in make_energyplus_env env = gym.make(env_id) File "/home/yhl/.local/lib/python3.6/site-packages/gym/envs/registration.py", line 156, in make return registry.make(id, **kwargs) File "/home/yhl/.local/lib/python3.6/site-packages/gym/envs/registration.py", line 100, in make spec = self.spec(path) File "/home/yhl/.local/lib/python3.6/site-packages/gym/envs/registration.py", line 142, in spec raise error.UnregisteredEnv('No registered env with id: {}'.format(id)) gym.error.UnregisteredEnv: No registered env with id: EnergyPlus-v0

real 0m1.702s user 0m1.747s sys 0m1.399s

Vesyrak commented 3 years ago

Had the same issue when testing _runenergyplus.py, environment is defined in _gymenergyplus/__init__.py. Issue can be resolved by adding the following to _runenergyplus.py: import gym_energyplus