question

James avatar image
0 Likes"
James asked Lion commented

Reinforcement training

I have some issues with debugging. The flexsim_env.py works but not the flexisim_training.py file. Able to help?capture.png

FlexSim 23.2.1
reinforcement learning
capture.png (65.5 KiB)
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

Kavika F avatar image
1 Like"
Kavika F answered Lion commented

Hey @James, at the top of your image, it says that you're using an Open AI Gym environment. The Stable-baselines3 package has moved towards using Gymnaisum instead. You'll have to change over the code in the provided example to be based around a gymnasium environment. Here's an example file you could try:

example_flexsim_env.py

There are a few main differences, such as the reset and step functions:

1695244056826.png

In the flexsim_training.py, you'll need to update the variables that get created/updated by those functions:

1695244148473.png

Let me know if this fixes your problem or if there are other things you run into.


· 17
5 |100000

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

James avatar image James commented ·

Yes. It works now. Thanks a lot

0 Likes 0 ·
Lion avatar image Lion commented ·

I can training model but that can't save

flexsim_training file I can run the program. But cannot save the model " Saving model...

Waiting for input to do some test runs..." How do I fix this? Basically, I fixed import gymnasium instead.

#import gym


error1.jpg1700151971665.png

0 Likes 0 ·
error1.jpg (259.6 KiB)
1700151971665.png (211.6 KiB)
Kavika F avatar image Kavika F ♦ Lion commented ·

@Lion , if you're getting errors, then show me screenshots of the errors. All I see in your screenshots are rewritten code and terminals showing proof it's running.

When it says "Waiting for input to do some test runs...", that's when it's waiting for you to hit "Enter" or some other keyboard input in the terminal to notify the program that you're ready to do test runs.

0 Likes 0 ·
Lion avatar image Lion Kavika F ♦ commented ·

This is the running result and Error display.1700187284671.png

0 Likes 0 ·
1700187284671.png (218.4 KiB)
Show more comments