Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Complete Example using stable-baselines #26

Closed
Error4046716 opened this issue Jun 29, 2022 · 5 comments
Closed

A Complete Example using stable-baselines #26

Error4046716 opened this issue Jun 29, 2022 · 5 comments

Comments

@Error4046716
Copy link

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
[<ipython-input-6-4ca9ec63cf36>](https://localhost:8080/#) in <module>()
     11 # env = gym.make('crypto-hedge-v0')
     12 
---> 13 model = A2C('MultiInputPolicy', env, verbose=0)
     14 model.learn(total_timesteps=1000)
     15 

2 frames
[/usr/local/lib/python3.7/dist-packages/stable_baselines3/common/base_class.py](https://localhost:8080/#) in __init__(self, policy, env, learning_rate, policy_kwargs, tensorboard_log, verbose, device, support_multi_env, create_eval_env, monitor_wrapper, seed, use_sde, sde_sample_freq, supported_action_spaces)
    189                 assert np.all(
    190                     np.isfinite(np.array([self.action_space.low, self.action_space.high]))
--> 191                 ), "Continuous action space must have a finite lower and upper bound"
    192 
    193     @staticmethod

AssertionError: Continuous action space must have a finite lower and upper bound

Where can set the lower and upper bound? Thank you

@AminHP
Copy link
Owner

AminHP commented Jun 30, 2022

Hi @Error4046716,

I added some commits to make the repo compatible with the newer versions of gym. However, stable_baselines is not compatible yet. You can try using stable-baselines3==1.5.0 with gym==0.21.0 for now. Also, you can change the lower and upper bound here.

@AminHP AminHP closed this as completed Jul 14, 2022
@AminHP AminHP reopened this Jul 14, 2022
@TomCS91
Copy link

TomCS91 commented Aug 7, 2022

This bug seems to still be active with the below versions.

Running torch 1.12.0 instead of 1.12.1 I thought fixed it as that worked on one machine but it didn't on another.

pip show stable-baselines3
Name: stable-baselines3
Version: 1.5.0

pip show gym
Name: gym
Version: 0.21.0

pip show torch
Name: torch
Version: 1.12.0

@salah2025
Copy link

How can I add technical indicators ?

@Emmanuel1524
Copy link

Just add some comment here: the Mtsim isnt working so well with StableBaseline3...

Even when I correct the Box adjustment bug, the algorithin doesn't fit so well with the RL algos

@AminHP
Copy link
Owner

AminHP commented Mar 17, 2023

Please install the latest version (v1.3.0).

@AminHP AminHP closed this as completed Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants