Closed LeZhengThu closed 3 years ago
As error states, you can only use one env for evaluation. You need to create a new DummyVecEnv that only contains one of your environments.
@Miffyli I mean if there's any way to use multiple envs to accelerate the training? If understand correctly, the purpose of the vectorized env, like DummyVecEnv, is to stack multiple independent environments into a single environment and speed up the training process.
Unfortunately not. This is further constrained by LSTM policies, which require same number of envs for predict
as they used during training. evaluate_policy
automatically does this for you.
If you can live without LSTM policies, check out SB3 where policies can be evaluated with multiple envs.
OK, that's fair. Thanks for the reply. I'll close this question.
Hi @araffin @Miffyli , I'm working with MlpLstmPolicy with DummyVecEnv and want to evaluate the policy. However, there's an error: AssertionError: You must pass only one environment when using this function. Below is the code that replicates my error.