Skip to content

Commit

Permalink
modify latest snapshot determination
Browse files Browse the repository at this point in the history
  • Loading branch information
sidhulyalkar committed Nov 30, 2023
1 parent 474269e commit 6278148
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions element_deeplabcut/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)

0 comments on commit 6278148

Please sign in to comment.