From 627814833d2005755cc011228dfc44faafbb0e17 Mon Sep 17 00:00:00 2001 From: Sidharth Hulyalkar Date: Wed, 29 Nov 2023 17:54:42 -0800 Subject: [PATCH] modify latest snapshot determination --- element_deeplabcut/train.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/element_deeplabcut/train.py b/element_deeplabcut/train.py index 8f61ddf..782ad8b 100644 --- a/element_deeplabcut/train.py +++ b/element_deeplabcut/train.py @@ -326,15 +326,17 @@ def make(self, key): # Here, we mean most recently generated # `snapshotindex` refers to the file index of the snapshot generated - # The most recent snapshot index will be the number of snapshots + # The most recent snapshot index will be the number of snapshots - 1 + # because it is an index # update snapshotindex in the config - dlc_config["snapshotindex"] = len(snapshots) + latest_snapshot = len(snapshots)-1 + dlc_config["snapshotindex"] = latest_snapshot edit_config( dlc_cfg_filepath, - {"snapshotindex": len(snapshots)}, + {"snapshotindex": latest_snapshot}, ) self.insert1( - {**key, "latest_snapshot": len(snapshots), "config_template": dlc_config} + {**key, "latest_snapshot": latest_snapshot, "config_template": dlc_config} )