Closed fbelderink closed 4 years ago
Hi!
Thanks for the pull request. But there are several problems with it:
this fix breaks situations when state is not a PyTorch tensor, but rather some other object specific to the model. For example, state might be a dictionary, meaningful to the model class. This approach used in several examples in the book, like this one: https://github.com/PacktPublishing/Deep-Reinforcement-Learning-Hands-On-Second-Edition/blob/master/Chapter16/lib/model_vnc.py#L44
the error you're fixing is not an error, but rather a feature of Gym, when some environment returns double-valued tensors instead of floats. Such situations are fully supported by ptan with float32_preprocessor
need to be passed to the agent like this: https://github.com/PacktPublishing/Deep-Reinforcement-Learning-Hands-On-Second-Edition/blob/master/Chapter11/01_cartpole_dqn.py#L53
Fixed RuntimeError: Expected object of type torch.FloatTensor but found type torch.DoubleTensor for argument #4 'mat1'