ImageNet-to-TFrecord icon indicating copy to clipboard operation
ImageNet-to-TFrecord copied to clipboard

random.shuffle doesn't work to shuffled_index, which affect the training results

Open tsaichasel opened this issue 3 years ago • 1 comments

there are some problem if using the code follow,because the function random.shuffle does not work to shuffled_index, which affect the training results.

  shuffled_index = range(len(filenames))
  random.seed(12345)
  random.shuffle(list(range(len(shuffled_index))))

I modify the code follow, it does work:

  shuffled_index = list(range(len(filenames)))
  random.seed(12345)
  random.shuffle(shuffled_index)

tsaichasel avatar Oct 22 '21 06:10 tsaichasel

Quite an important fix, this! Training with samples entirely in order simply doesn't work.

rjbruin avatar Mar 22 '22 14:03 rjbruin