Hindsight-Experience-Replay icon indicating copy to clipboard operation
Hindsight-Experience-Replay copied to clipboard

Date type problem

Open Alchemist77 opened this issue 3 years ago • 0 comments

Thank you for sharing this code.

When I run this code, I got the error

In DQNAgentWithHER.py, Line 106 q_pred = self.q_eval.forward(concat_state_goal)[batches, action]

IndexError: tensors used as indices must be long, byte or bool tensors

I already checked dtype and shape then I got it

    print(concat_state_goal.dtype)            torch.float32
    print(batches.dtype)                             int64
    print(action.dtype)                                torch.float32

    print(concat_state_goal.shape)           torch.Size([64, 16])
    print(batches.shape)                            (64,)
    print(action.shape)                               torch.Size([64, 8])

Could you provide me which is the problem? (what is the difference between your output and mine..)

Thank you.

Alchemist77 avatar Jan 25 '21 18:01 Alchemist77