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 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

#You don't want this

#You want either this if you registered it

#Or this if you did not

Thank you. That was spot on.