Trial_runner.py issue

Hello, I ran into this problem:

in register_if_needed raise ValueError(
ValueError: <OrderEnforcing<MyEnv>>is an invalid env specification. You can specify a custom env as either a class (e.g., YourEnvCls) or a registered env id (e.g., “your_env”).
INFO trial_runner.py:632 – Trial BaselinePPOTrainer
<OrderEnforcing<MyEnv>>_00000: Attempting to restore trial state from last checkpoint.
The environment is created and registered using gym.make().

Do you have a reproduction script and the full stack trace available?

I think you may have passed an instantiated object rather than the class.

class MyEnv(gym.Env):
    #Implement reset and step
    pass


#You don't want this
config["env"]=MyEnv(env_config)

#You want either this if you registered it
config["env"]="MyEnv"

#Or this if you did not
config["env"]=MyEnv

Thank you. That was spot on.