cityujun / hvac_offline_rl

MIT License
4 stars 0 forks source link

Inquiry about Broken Pipe Issue in EnergyPlus Environment #2

Open paradox-ljt123 opened 5 days ago

paradox-ljt123 commented 5 days ago

Hello, I am currently working with the EnergyPlus environment implementation provided in your project, and I encountered a persistent issue that I was hoping to get your insights on.

The problem arises during the execution of an epoch in the environment. Specifically, after completing an epoch, the program throws a "broken pipe" error at the following line in the send_action method: self.pipe_io.flush() I have tried modifying parameters such as the number of steps per epoch, but the error persists consistently at the end of each epoch.

Thank you very much!

2024-11-20 17:30:33 [info ] Model parameters are saved to d3rlpy_logs/SAC_online_20241120165843/model_50000.d3 2024-11-20 17:30:33 [info ] SAC_online_20241120165843: epoch=1 step=50000 epoch=1 metrics={'time_inference': 0.0014333057403564454, 'time_environment_step': 0.0036938034629821776, 'time_step': 0.006596297636032105, 'time_sample_batch': 0.07379713982343673, 'time_algorithm_update': 0.0135210981965065, 'temp_loss': 5.957389007806778, 'temp': 0.8925118469446898, 'critic_loss': 7.3253422808647155, 'actor_loss': 8.111978513137437, 'evaluation': -314188.2399149289} step=50000 5%|███▌ | 50000/1000000 [31:49<10:04:40, 26.19it/s] Traceback (most recent call last): File "/root/hvac_offline_rl-main/ibm_datacenter/main/generation_runs.py", line 52, in <module> collect_dataset_from_training_policy(env, File "/root/hvac_offline_rl-main/common/d3rlpy_utils.py", line 97, in collect_dataset_from_training_policy online_train_with_buffer(env, buffer_size, cache_size, File "/root/hvac_offline_rl-main/common/d3rlpy_utils.py", line 144, in online_train_with_buffer policy.fit_online(env, File "/root/miniconda3/lib/python3.10/site-packages/d3rlpy/algos/qlearning/base.py", line 669, in fit_online ) = env.step(action) File "/root/miniconda3/lib/python3.10/site-packages/gymnasium/wrappers/time_limit.py", line 57, in step observation, reward, terminated, truncated, info = self.env.step(action) File "/root/miniconda3/lib/python3.10/site-packages/gymnasium/wrappers/order_enforcing.py", line 56, in step return self.env.step(action) File "/root/miniconda3/lib/python3.10/site-packages/gymnasium/wrappers/env_checker.py", line 51, in step return self.env.step(action) File "/root/hvac_offline_rl-main/ibm_datacenter/src/envs/energyplus_env.py", line 191, in step if not self.send_action(): File "/root/hvac_offline_rl-main/ibm_datacenter/src/envs/energyplus_env.py", line 221, in send_action self.pipe_io.flush() File "/root/hvac_offline_rl-main/ibm_datacenter/src/envs/pipe_io.py", line 91, in flush self.act_pipe.flush() BrokenPipeError: [Errno 32] Broken pipe

cityujun commented 4 days ago

I do not know your platform and EnergyPlus version. I use the EnergyPlus 22.2.0 on Ubuntu 20.04.

More importantly, you should first follow the instructions in IBM repo rl-testbed-for-energyplus. Basically, after installing EnergyPlus, there are two additional steps which are building patched package (provided in this repo) and installing built executables.