AminHP / gym-anytrading

The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)
MIT License
2.09k stars 459 forks source link

SB3 check_env() Error #59

Closed 0trade closed 2 years ago

0trade commented 2 years ago
import gym
from gym_anytrading.envs import TradingEnv, ForexEnv, Actions, Positions
from gym_anytrading.datasets import FOREX_EURUSD_1H_ASK
from stable_baselines3.common.env_checker import check_env

env = gym.make('forex-v0', frame_bound=(10, 500), window_size=10)
check_env(env)

The error message:

AssertionError: The observation returned by the `reset()` method does not match the given observation space
AminHP commented 2 years ago

I just get this warning:

"UserWarning: Your observation has an unconventional shape (neither an image, nor a 1D vector). We recommend you to flatten the observation to have only a 1D vector or use a custom policy to properly process the data."

0trade commented 2 years ago

The error was gone, when I switch to other conda environments, I think the problem maybe is stable-baseline3 or gym version.