0
from stable_baselines3 import A2C
model=A2C('MlpPolicy',env,verbose=1)
model.learn(total_timesteps=10000)

I am using this on CartPole-v1

env=gym.make('CartPole-v1')

And I am getting

RuntimeError: Could not infer dtype of numpy.float32
desertnaut
  • 57,590
  • 26
  • 140
  • 166
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 17 '22 at 18:16

1 Answers1

0

it is problem with combability, so for start my recommendations update your pytorch I solved this problem for python3.10 with the next version of pytorch

pip install torch===1.11.0 torchvision===0.1.6 -f https://download.pytorch.org/whl/torch_stable.html

dfsdf
  • 37
  • 9
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 23 '22 at 14:16