Closed EloyAnguiano closed 8 months ago
Can you provide me with your training script ? I cannot reproduce it with all the things I have done :-/
Yes, I will "get a photo" of the state of the grid when this happens to reproduce it. Do you recommend checking any value in particular apart from topology and load values?
The training script would be better. the "photo" of the grid is not that usefull :-/
Also, is this for the environment (env.step
) or the forecast (obs.simulate
or obs.get_forecasted_env
) or the Simulator (obs.get_simulator
) ?
Do you recommend checking any value in particular apart from topology and load values?
Problem is in the topology, somehow a load is disconnected but the flag "done" is not True
Also have you checked that:
1) you did not recode a RL model from scratch and use for example stable-baselines3 or ray / rllib or any other "presumed without bug" machine learning model ? If you coded the training of a ML / RL model from scratch, please check that you don't use the grid when done=False
2) which gym env are you using ? which version of gymnasium (or gym if you are stick with gym) are you using ?
3) you train on a single machine single core ? or is there any parralelllism / asynchron happening somewhere ? If you are you sure you don't use the same backend for different environment ?
4) (i'll keep writing if I get other ideas)
For point 3 above I mean:
you SHOULD NOT DO:
import grid2op
from lightsim2grid import LightSimBackend
backend = LightSimBackend()
env1 = grid2op.make(env_name, backend=backend)
env2 = grid2op.make(env_name, backend=backend)
But always:
import grid2op
from lightsim2grid import LightSimBackend
env1 = grid2op.make(env_name, backend=LightSimBackend())
env2 = grid2op.make(env_name, backend=LightSimBackend())
That should not be a problem as I instantiate the backend at each subprocess. You have a code snippet above. I am going to keep updating it to make it simpler for the problem
Is this enought? Do you need any explanation of any step or class?
I'll have a look asap :-) But that's a first step yes. Thanks a lot :-)
Oh I see this is caused by storage units and not by generator or loads. I will see how to reproduce it and bring a fix for this.
By the way, if you want to get rid of this issue, you can install the package from source (following the instruction) or from a compiled version here for example: https://github.com/BDonnot/lightsim2grid/actions/runs/6668902300 (choose the right file to download depending on your python version)
Or you can pip install the development version: pip install LightSim2Grid==0.7.6.dev0
Should be fixed by now. Re open if you still encounter this bug :-)
Environment
1.9.5
0.7.5
0.21.0
0.28.1
2.0.0
ubuntu20.04
l2rpn_idf_2023
Bug description
There are some grid states that lead to a RuntimeError whenever I try to set a busbar for a line extremity. The action performed loks like this:
How to reproduce
Code snippet
Current output
Expected output
If it really is an action that cannot be performed It should lead to some illegal action or error action and truncate the episode, not raising a RuntimeError that stops the execution.