【问题标题】:stable baslines3 runtime error: cannot infer dtype of numpy.float32稳定的 baslines3 运行时错误:无法推断 numpy.float32 的 dtype
【发布时间】:2022-11-10 18:55:38
【问题描述】:
from stable_baselines3 import A2C
model=A2C('MlpPolicy',env,verbose=1)
model.learn(total_timesteps=10000)

我在 CartPole-v1 上使用它

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

我得到

RuntimeError: Could not infer dtype of numpy.float32

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如它目前所写的那样,很难准确地说出你在问什么。

标签: python machine-learning reinforcement-learning stable-baselines


【解决方案1】:

这是可梳理性的问题,所以首先我的建议是更新你的 pytorch 我用下一版本的pytorch解决了python3.10的这个问题

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

【讨论】:

  • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 2021-04-18
  • 1970-01-01
  • 1970-01-01
  • 2010-12-03
  • 2020-01-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-07
相关资源
最近更新 更多