I don’t know, why the error is raised, but it seems to be raised by recreating the iterator for the valid_queue inside the training DataLoader loop in combination with pinned memory.
If I initialize the iterator before entering the loop, the code works fine. Also, if I disable pinned memory for valid_queue.
CC @vincentqb have you seen this issue or a similar before?