paninski-lab / deepgraphpose

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

Do we need to train DLC prior to run the dgp pipeline #10

Open ZhanqiZhang66 opened 3 years ago

ZhanqiZhang66 commented 3 years ago

This might be a stupid question. I followed the guideline all the way to step 4 and as I run the command in step 5 I received the following message. It is asking for the trained DLC network. Do we need to train DLC prior to run the dgp pipeline or am I missing a step here?

Thanks in advance! Great model

Update: If you think "hey I have the same question". You need to follow the same DLC steps until the step Create training dataset, which will create {PROJ_DIR}/task-scorer-date/dlc-models/iteration-0/dgpdate-trainset95shuffle1/train/pose_cfg.yaml' .

Specifically, go through Welcome -> Manage Project -> Extract Frames -> Label Frames -> Create training dataset. You should see _"The training dataset is successfully created. Use the function 'trainnetwork' to start training. Happy training! " from your terminal.

Then run the command in step 5 `python ['{DGP_DIR}/demo/run_dgp_demo.py'] --dlcpath '{PROJ_DIR}/task-scorer-date/' --shuffle 'the shuffle to run' --dlcsnapshot 'specify the DLC snapshot if you\'ve already run DLC with location refinement

However, this still won't get training started. It will show "Start Training" in the terminal and stuck there for hours. Any suggestions?

config_path /home/victoria/Github/deepgraphpose/dgp-victoria-2021-03-15/config.yaml
Traceback (most recent call last):
  File "/home/victoria/Github/deepgraphpose/demo/run_dgp_demo.py", line 179, in <module>
    fit_dlc(snapshot, dlcpath, shuffle=shuffle, step=0)
  File "/home/victoria/Github/deepgraphpose/src/deepgraphpose/models/fitdgp.py", line 92, in fit_dlc
    dlc_cfg = load_config(pose_config_yaml)
  File "/home/victoria/Github/deepgraphpose/src/DeepLabCut/deeplabcut/pose_estimation_tensorflow/config.py", line 55, in load_config
    return cfg_from_file(filename)
  File "/home/victoria/Github/deepgraphpose/src/DeepLabCut/deeplabcut/pose_estimation_tensorflow/config.py", line 42, in cfg_from_file
    with open(filename, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/victoria/Github/deepgraphpose/dgp-victoria-2021-03-15/dlc-models/iteration-0/dgpMar15-trainset95shuffle1/train/pose_cfg.yaml'
waq1129 commented 3 years ago

Hi

Thanks for the update and clarification.

For the error you posted, do you have that pose_cfg.yaml there?

For the long time stucking, it might due to the selection of unlabeled frames depending on how many frames and videos you have? DGP need to select unlabeled frames for training based on motion energy which requires the calculation of frame difference for all time points which usually takes a long time. But it only happens once. Is that the same reason in your case? You can add a print message saying "start motion energy" entering this function. If you see the message and stuck there for hours, then it's running motion energy.