AminHP / gym-anytrading

The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NOT A BUG - General Help: Observation Spaces do not match

QuantumCrazy opened this issue · comments

Hi Amin,

I've modularized my code and I have now a separate script for training/testing a gym RL model then saving the model as .zip and another script for loading the .zip model into an env initialized with new data including unseen data. I have used the same parameters (window, episodes, frame bounds, train/test split, env type etc) in training/testing and loading but it keeps throwing an error that my observation spaces do not match:

ValueError(f"Observation spaces do not match: {observation_space} != {env.observation_space}")
Box(-inf, inf, (AA,BB), float32) != Box(-inf, inf, (CC,BB),float32)

My env observation space contains the correct parameters CC and BB but they should be CC and BB in the "observation_space". I'm trying to figure out where the AA value came from and why its not equal to CC. How can we call the "observation_space" from a saved gym .zip model? I need to find out where it comes from.....

Thanks!

I'm closing this off....I've solved the issue :)))

It was an issue with my code structure and loop logic. I've got my own hyperparameter tuning logic and I had to optimize the loops