Description
Hi,
Playing around with stable baselines 2.9.0 (installed with pip) on Ubuntu 18.04.4 LTS with Python 3.6.9, gym 0.16.0, tensorflow 1.14.0 and pybullet 2.6.5.
When I run
python enjoy.py --algo ppo2 --env HalfCheetahBulletEnv-v0 -- folder trained_agents/ -n 150000
all is well.
When I run
python enjoy.py --algo ppo2 --env HalfCheetahBulletEnv-v0 -- folder logs/ -n 150000
so that enjoy.py loads the model I have trained and saved with train.py, I get the following error..
"Error: the environment passed must have at least the same observation space as the model was trained on."
When I've been trying to see what the problem is today I've noticed that, because of the stored hyperparameters for ppo2 HalfCheetahBulletEnv-v0, train.py wraps the training environment in the TimeFeatureWrapper wrapper from utils/wrappers.py but enjoy.py does not because end up going into the elif "Bullet" in env_id:
statement in the create_test_env() method in utils/utils.py.
I've looked and the wrapper changes the observation space from (26,) to (27,) so that may be what it is complaining about in the error message.
Am I barking up the right tree and how come the error doesn't occur with the zoo trained_agents saved models?
Thank you!