question

katerina-fratczak avatar image
0 Likes"
katerina-fratczak asked katerina-fratczak commented

Reinforcement learning - problem by test runs

Hello,

I have problem by running the training test runs of my model with push logic and two decision events:1720002556798.png

In python stops it like this:1720002593625.png

The python scripts (modified long time ago by us because the original training scripts did not run well) run by the training model well. I am not sure now, if the problem is in FlexSim or in python.

Thank you

15_our_3_model_push.fsm

flexsim_env.py

flexsim_training.py

reinforcement learning
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jordan Johnson avatar image
2 Likes"
Jordan Johnson answered katerina-fratczak commented

I did a little debugging. I think something may have changed with stable_baselines3 since we wrote the demo script. It looks like the return value of model.predict() is a tuple containing the array of actions, rather than just the array of actions.

To fix it, I changed:

action = model.predict(observation)

to this:

(action, _) = model.predict(observation)

The second version "unpacks" the tuple and saves the first value in the action variable.

I'll add an issue to our bug list to investigate this issue, to see if we need to adjust to changing software.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

katerina-fratczak avatar image katerina-fratczak commented ·

Hello, thank you very much! I have changed it in the training.py as you suggested and it works now :-)

1720074256648.png

0 Likes 0 ·
1720074256648.png (25.2 KiB)