最近在复现论文Multi-Agent Actor-Critic for Mixed
Cooperative-Competitive Environments
跑代码遇到一些错误。
RuntimeError: Found dtype Double but expected Float
将代码中的类型替换后,又出现错误
RuntimeError: Found dtype Float but expected Double
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [256]] is at version 3; expected version 2 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
最后将pytorch降级搞定了,不用改啥代码。
降级先删除现有的。再安装降级后的。
pip list
pip uninstall torch
pip install torch==1.4.0
pettingzoo