Open fredkingdom opened 4 months ago
I'm not sure the specific situation. May be the max value of sampe_idx is len(dataset_len) - 1?
May be the max value of sampe_idx is len(dataset_len) - 1?
Yes. Randint function chooses from [0, dataset_len], which includes idx==dataset_len, thus causing the problem.
In train_stage_1.py, line 167, the correct code should be
sample_idx = [random.randint(0, dataset_len-1) for _ in range(2)]
instead ofsample_idx = [random.randint(0, dataset_len) for _ in range(2)]
, since if you happen to choose idx=dataset_len, it will be out of range.