paninski-lab / deepgraphpose

DeepGraphPose
GNU Lesser General Public License v3.0
32 stars 9 forks source link

Code in command prompt runs, now what? #16

Open wweertman opened 3 years ago

wweertman commented 3 years ago

I ran the code in command prompt and trained a model. How do I use this model without going through the whole training process again? I see that it has created snapshots in my dlc-models directory however I cannot use these with deeplabcut workflow.

runfile('C:/Users/wlwee/Documents/python/fhl_three_target_experiment/CODE/creating_rotated_data/test_deepgraphpose_model.py', wdir='C:/Users/wlwee/Documents/python/fhl_three_target_experiment/CODE/creating_rotated_data')
Traceback (most recent call last):

  File "<ipython-input-683-4679c477922f>", line 1, in <module>
    runfile('C:/Users/wlwee/Documents/python/fhl_three_target_experiment/CODE/creating_rotated_data/test_deepgraphpose_model.py', wdir='C:/Users/wlwee/Documents/python/fhl_three_target_experiment/CODE/creating_rotated_data')

  File "C:\Users\wlwee\Anaconda3\envs\DLC-GPU\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

  File "C:\Users\wlwee\Anaconda3\envs\DLC-GPU\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "C:/Users/wlwee/Documents/python/fhl_three_target_experiment/CODE/creating_rotated_data/test_deepgraphpose_model.py", line 27, in <module>
    destfolder = snapshot_dirs[m])

  File "C:\Users\wlwee\Anaconda3\envs\DLC-GPU\lib\site-packages\deeplabcut\pose_estimation_tensorflow\predict_videos.py", line 207, in analyze_videos
    increasing_indices = np.argsort([int(m.split("-")[1]) for m in Snapshots])

  File "C:\Users\wlwee\Anaconda3\envs\DLC-GPU\lib\site-packages\deeplabcut\pose_estimation_tensorflow\predict_videos.py", line 207, in <listcomp>
    increasing_indices = np.argsort([int(m.split("-")[1]) for m in Snapshots])
waq1129 commented 3 years ago

Hi

If you finish training and just want to test the DGP model, you could start from https://github.com/paninski-lab/deepgraphpose/blob/main/demo/run_dgp_demo.py#L249

set snapshot to be the name of the snapshot you want to check.