PacktPublishing / Deep-Reinforcement-Learning-Hands-On

Hands-on Deep Reinforcement Learning, published by Packt
MIT License
2.83k stars 1.28k forks source link

02_pong_a2c.py not working with argument --cuda #23

Closed iimmer closed 5 years ago

iimmer commented 5 years ago

Traceback (most recent call last): File "d:/Python/WS/PyTorch/Deep-Reinforcement-Learning-Hands-On/Chapter10/02_pong_a2c.py", line 159, in tb_tracker.track("advantage", adv_v, step_idx) File "D:\Python\WinPython3670\python-3.6.7.amd64\lib\site-packages\ptan\common\utils.py", line 329, in track self.writer.add_scalar(param_name, np.mean(data), iter_index) File "D:\Python\WinPython3670\python-3.6.7.amd64\lib\site-packages\numpy\core\fromnumeric.py", line 2957, in mean out=out, **kwargs) File "D:\Python\WinPython3670\python-3.6.7.amd64\lib\site-packages\numpy\core_methods.py", line 80, in _mean ret = ret.dtype.type(ret / rcount) AttributeError: 'torch.dtype' object has no attribute 'type'

Shmuma commented 5 years ago

Which version of pytorch you're using? This bug looks like a some incompatibility in ptan with recent pytorch (only pytorch 0.4 is currently supported by examples).

iimmer commented 5 years ago

Which version of pytorch you're using? This bug looks like a some incompatibility in ptan with recent pytorch (only pytorch 0.4 is currently supported by examples).

I have updated pytorch to 1.0, pytorch 0.4 is working ,thank you !

icompute386 commented 5 years ago

1.0.1, that may be the issue