I think this worked for me as a workaround:
def train(train_queue, valid_queue):
    i = iter(valid_queue)
    for step, (input, target) in enumerate(train_queue):
        input_search, target_search = next(i)