PacktPublishing / Deep-Reinforcement-Learning-Hands-On

Hands-on Deep Reinforcement Learning, published by Packt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Indexing with dtype torch.uint8 is now deprecated

rracinskij opened this issue · comments

Hi,
running the code from Chapter08 with Pytorch 1.3.0 and Gym 0.15.4 leads to a following warning:
/pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.
Not sure about the reason.

Hi!

Example in the first edition of the book have requirement of pytorch 0.4.1 and gym 0.10.3 (which is noted in the book and in requirements.txt: https://github.com/PacktPublishing/Deep-Reinforcement-Learning-Hands-On/blob/master/requirements.txt).

Latest version of libraries are supported in the second edition, which has a separate repo here: https://github.com/PacktPublishing/Deep-Reinforcement-Learning-Hands-On-Second-Edition
This book is expected to be published in Dec, and not all examples are fully tested, but you can check new repo for ideas.

This particular problem is trivial to fix by replacing ByteTensor with BoolTensor, but I strongly recommend to use PyTorch 0.4.1 with the first edition examples, because there are more issues related to new version incompatibilities.

Thank you!