@@ -246,6 +246,7 @@ def make(self, key):
246246 try :
247247 from deeplabcut .utils .auxiliaryfunctions import (
248248 get_model_folder ,
249+ edit_config ,
249250 ) # isort:skip
250251 except ImportError :
251252 from deeplabcut .utils .auxiliaryfunctions import (
@@ -278,6 +279,20 @@ def make(self, key):
278279 # Write dlc config file to base project folder
279280 dlc_cfg_filepath = dlc_reader .save_yaml (project_path , dlc_config )
280281
282+ # ---- Update the project path in the DLC pose configuration (yaml) files ----
283+ model_folder = get_model_folder (
284+ trainFraction = dlc_config ["train_fraction" ],
285+ shuffle = dlc_config ["shuffle" ],
286+ cfg = dlc_config ,
287+ modelprefix = dlc_config ["modelprefix" ],
288+ )
289+ model_train_folder = project_path / model_folder / "train"
290+
291+ edit_config (
292+ model_train_folder / "pose_cfg.yaml" ,
293+ {"project_path" : project_path .as_posix ()},
294+ )
295+
281296 # ---- Trigger DLC model training job ----
282297 train_network_input_args = list (inspect .signature (train_network ).parameters )
283298 train_network_kwargs = {
@@ -293,18 +308,7 @@ def make(self, key):
293308 except KeyboardInterrupt : # Instructions indicate to train until interrupt
294309 print ("DLC training stopped via Keyboard Interrupt" )
295310
296- snapshots = list (
297- (
298- project_path
299- / get_model_folder (
300- trainFraction = dlc_config ["train_fraction" ],
301- shuffle = dlc_config ["shuffle" ],
302- cfg = dlc_config ,
303- modelprefix = dlc_config ["modelprefix" ],
304- )
305- / "train"
306- ).glob ("*index*" )
307- )
311+ snapshots = list (model_train_folder .glob ("*index*" ))
308312 max_modified_time = 0
309313 # DLC goes by snapshot magnitude when judging 'latest' for evaluation
310314 # Here, we mean most recently generated
0 commit comments