Open sebnapi opened 1 year ago
Hey, @XiaoYangLiu-FinRL can you give me some ideas on how to fix that? I don't really understand why the reference is the same, the StockTradingEnv
object should be always a new different one.
I tried downgrading to stable-baselines3==1.7.0 before the check, that had some other consequences:
!pip3 install setuptools==65.5.0 # https://github.com/openai/gym/issues/3176 !pip install git+https://github.com/openai/gym.git@9180d12e1b66e7e2a1a622614f787a6ec147ac40 # https://github.com/openai/gym/issues/3202 !pip install stable_baselines3==1.7.0
But now training wont work at all, because there is a mismatch between gym==0.17 and gymnasium. Absolute bottom less pit, machine learning broke python, this feels like javascript.
FinRL is using gymnsium and the elegantrl dependency is using gym.
It might be helpful to just dockerize the application with fixed requirements, as the different versions break the code all the time.
167 if supported_action_spaces is not None:
--> 168 assert isinstance(self.action_space, supported_action_spaces), (
169 f"The algorithm only supports {supported_action_spaces} as action spaces "
170 f"but {self.action_space} was provided"
171 )
173 if not support_multi_env and self.n_envs > 1:
174 raise ValueError(
175 "Error: the model does not support multiple envs; it requires " "a single vectorized environment."
176 )
AssertionError: The algorithm only supports (<class 'gym.spaces.box.Box'>, <class 'gym.spaces.discrete.Discrete'>, <class 'gym.spaces.multi_discrete.MultiDiscrete'>, <class 'gym.spaces.multi_binary.MultiBinary'>) as action spaces but Box(-1.0, 1.0, (29,), float32) was provided
When running:
I run into this issue:
https://github.com/DLR-RM/stable-baselines3/issues/1151
in this spot:
https://github.com/AI4Finance-Foundation/FinRL/blob/7414adb012b554f7c684d4615830dc5c31a094d1/finrl/agents/stablebaselines3/models.py#L287-L310