Hi,
When trying to load 'last' snapshot there's a bug as it doesnt always load the last one.
consider the case we have itr_0.pkl,itr_20.pkl,itr_40.pkl,....,itr_120.pkl.
if we want to load the 'last' snapshot, the snapshotter load code search for 'params.pkl' and if not found it sorts the list of files with itr_{}.pkl template (snapshotter.py line 162):
files.sort()
and then take the last.
However, sorting this way will not yield the last iteration pkl but itr_80.pkl because this is the highest alphabetical value.
a proposed fix would be to replace line 162 with the following:
Hi, When trying to load 'last' snapshot there's a bug as it doesnt always load the last one. consider the case we have itr_0.pkl,itr_20.pkl,itr_40.pkl,....,itr_120.pkl.
if we want to load the 'last' snapshot, the snapshotter load code search for 'params.pkl' and if not found it sorts the list of files with itr_{}.pkl template (
snapshotter.py
line 162):and then take the last.
However, sorting this way will not yield the last iteration pkl but itr_80.pkl because this is the highest alphabetical value.
a proposed fix would be to replace line 162 with the following:
which isolate the iteration number and sort by its numerical value.
Thanks,