However, it is adviced to use tune to run your experiments. With tune you also have the ExperimentAnalysis class to load the expriment configuration from your experiment and use this to build your trainer.
For a better understanding of your problem I suggest you to also always add the exact error messages to your posts. That helps us to find the source code that errors out.
@Lars_Simon_Zehnder Thanks! This is the error which I get if I remove the env from config
ValueError: `observation_space` not provided in PolicySpec for default_policy and env does not have an observation space OR no spaces received from other workers' env(s) OR no `observation_space` specified in config!
I want to use the trained model for prediction without having the environment class, is this possible?
Checkout the cartpole server example’s config here:
You need to set:
config = {
# Indicate that the Algorithm we setup here doesn't need an actual env.
"env": None,
"observation_space": <obs-space>,
"action_space": <action-space>,
# ...
}