ikostrikov / pytorch-a3c

PyTorch implementation of Asynchronous Advantage Actor Critic (A3C) from "Asynchronous Methods for Deep Reinforcement Learning".
MIT License
1.23k stars 280 forks source link

File "main.py", line 55,TypeError: sum received an invalid combination of arguments #38

Closed happykayy closed 6 years ago

happykayy commented 6 years ago

File "main.py", line 55, in env.observation_space.shape[0], env.action_space) File "/home/bruce/Downloads/pytorch-a3c-master/pytorch-a3c-master/model.py", line 47, in init self.actor_linear.weight.data, 0.01) File "/home/bruce/Downloads/pytorch-a3c-master/pytorch-a3c-master/model.py", line 9, in normalized_columns_initializer out *= std / torch.sqrt(out.pow(2).sum(1, keepdim=True)) TypeError: sum received an invalid combination of arguments - got (int, keepdim=bool), but expected one of:

my environment is Ubuntu 14.04 I just run your code without change and the error comes out, please help,thanks

ikostrikov commented 6 years ago

What is the version of PyTorch that you are using?

print(torch.version)

happykayy commented 6 years ago

0.1.12

ikostrikov commented 6 years ago

Try to install the latest one. They changed API in 0.2.0.

happykayy commented 6 years ago

ok,thanks !