IBM / rl-testbed-for-energyplus

Reinforcement Learning Testbed for Power Consumption Optimization using EnergyPlus
MIT License
177 stars 74 forks source link

send_action's pipe_io.writeline error #52

Closed JerelynCo closed 3 years ago

JerelynCo commented 3 years ago

Hi! I'm interested on replicating your paper results but I'm hitting a problem when sending action values to the pipeline. Below are some information about my efforts:

From the traceback, it seems that line 213 from energyplus_env.py formats the action into a string. However, the action value contains a list, hence the error. Is this really the expected behavior or did I miss a step?

I hope for your help as I'm really eager to test your testbed out! Thank you.

antoine-galataud commented 3 years ago

Hi @JerelynCo. Can you print/debug the content of action as received at https://github.com/IBM/rl-testbed-for-energyplus/blob/bba0be7413680bd3f80b11f76cb6d21dec1d5145/gym_energyplus/envs/energyplus_env.py#L181

Also, what version of gym and baselines are you using?

JerelynCo commented 3 years ago

Hi @antoine-galataud , thanks for your quick response! Here's the screenshot of action inside step function: image

As for my dependencies version: image

Just a quick note: I'm using Poetry as my package manager. I also had a problem installing baselines (mujoco-py problem) using the pypi version and so I installed from the baselines repository: https://github.com/openai/baselines

Kindly let me know if you need more information.

Thanks!

JerelynCo commented 3 years ago

Hi @antoine-galataud , I tried versions 9.1 and 9.2 for the mean time. However, I encounter different problems. I understand that the details below might be better posted in a separate issue, but the problems I'm having might be connected to each other (perhaps library incompatibility issue?).

For 9.1 It seems that rl-testbed-for-energyplus repo doesn't contain model objects for 9.1. https://github.com/IBM/rl-testbed-for-energyplus/tree/master/EnergyPlus

As a workaround, I copied the Model-8-8-0 to Model-9-1-0 and updated the idf file version to 9.1. image

However, I encountered problem as described in the eplusout.err file: image

For 9.2 In this case, I encountered a patching warning. image

I continued to run a simulation anyway and encountered the problem with the same message as this issue https://github.com/IBM/rl-testbed-for-energyplus/issues/29.

It might be because of the patching warning I got.

If you have any idea, please let me know. Thank you!

antoine-galataud commented 3 years ago

For the action type, I don't get why the array is wrapped in another one. Can you try with gym 0.17 instead? Otherwise you'll have to slightly modify the code, something like action = action[0] at the beginning of step

For EnergyPlus models: you can't just update model version, you need to use IDFVersionUpdater (in PreProcess/IDFVersionUpdater/ of EnergyPlus home installation).

For EnergyPlus 9.2 path: this can be safely ignored, it works fine even with this warning.

JerelynCo commented 3 years ago

@antoine-galataud , thanks for your response.

For the action type, I don't get why the array is wrapped in another one. Can you try with gym 0.17 instead? Otherwise you'll have to slightly modify the code, something like action = action[0] at the beginning of step

Understood. I tried changing the gym version to 0.17 but it still resulted to the same problem. As a result, I tweaked the code to action = action[0] as you recommended and it did run. I'm now waiting for it to finish to run.

For EnergyPlus models: you can't just update model version, you need to use IDFVersionUpdater (in PreProcess/IDFVersionUpdater/ of EnergyPlus home installation).

Understood. I haven't really tried using EnergyPlus software. Will explore more on this later.

For EnergyPlus 9.2 path: this can be safely ignored, it works fine even with this warning.

I see. Will try this again and post another issue if the [https://github.com/IBM/rl-testbed-for-energyplus/issues/29#issuecomment-514471328](same problem) persist.

Thanks for your kind support.

AlejandroCN7 commented 3 years ago

I have had the same problem in version 9.3.0, adding action = action[0] as @antoine-galataud comments solves the problem (in if action is not None block)

antoine-galataud commented 3 years ago

@AlejandroCN7 this will be solved with #54. @takaomoriyama let me know if there’s anything else to update in it.