Open ShawnLixx opened 5 years ago
Also, random.seed
should be called in the main
function of training scripts.
This is only a problem if you're using Python < 3.6 3.6 onwards, insertion order is maintained for the default dictionary as well.
https://stackoverflow.com/questions/1867861/how-to-keep-keys-values-in-same-order-as-declared
But still I do agree that it's more backward compatible to change it to OrderedDict
as @ShawnLixx suggests
Even OrderedDict and random.seed are used, the results are still not reproducible.
https://github.com/dragen1860/MAML-Pytorch/blob/98a00d41724c133bd29619a2fb2cc46dd128a368/MiniImagenet.py#L81 should be changed to
OrderedDict
.Result can't be reproduced because the use of dictionary. Iterating over dict causes randomness. https://github.com/dragen1860/MAML-Pytorch/blob/98a00d41724c133bd29619a2fb2cc46dd128a368/MiniImagenet.py#L68