Flappy-bird-deep-Q-learning-pytorch
Flappy-bird-deep-Q-learning-pytorch copied to clipboard
Error Running Train.py
Flappy-bird-deep-Q-learning-pytorch/src/deep_q_network.py:21: UserWarning: nn.init.uniform is now deprecated in favor of nn.init.uniform_.
nn.init.uniform(m.weight, -0.01, 0.01)
Perform a random action
Iteration: 2/2000000, Action: 1, Loss: 0.010123813524842262, Epsilon 0.1, Reward: 0.1, Q-value: 0.0005683371564373374
Traceback (most recent call last):
File "train.py", line 133, in
I meet the question so. It cause bytorch version. In latest torch, 0-dim tensor is invaild, 我也遇到这问题,是torch版本引起的,稍作修改即可。
Change code line77
action = torch.argmax(prediction)[0]
To
action = torch.argmax(prediction)
I tried that. Still errors
(python36) C:\Flappy-bird-deep-Q-learning-pytorch>python train.py
Traceback (most recent call last):
File "train.py", line 15, in
@2448845600 thanks, guy! fix my problem.
@2448845600 谢谢~搞定啦