Skip to content

pickle file not saved to dlc_models subfolder #753

Description

@neurologic

Your Operating system and DeepLabCut version
MacOS with Anaconda Env DLC-CPU created from deeplabcut's env file
DeepLabCut version 2.2b6

Describe the problem
I have successfully created a project, labelled frames, checked frames, and trained the dataset.
I am working from within pythonw for the following steps.

Before training the dataset I ran:

deeplabcut.cropimagesandlabels(config_path)

To train the dataset I ran:

[deeplabcut.create_multianimaltraining_dataset(config_path)]

There were some errors, but an alternate path was taken?

Code output

[/Users/kperks/Documents/Wesleyan_Research/DLC_data/GroupFish/GroupFish-KPerks-2020-06-15/labeled-data/GroupFish1_dnsampled_cropped_cropped/CollectedData_KPerks.h5  not found (perhaps not annotated). If training on cropped data, make sure to call `cropimagesandlabels` prior to creating the dataset.
/Users/kperks/Documents/Wesleyan_Research/DLC_data/GroupFish/GroupFish-KPerks-2020-06-15/labeled-data/GroupFish4_compressed_cropped_cropped/CollectedData_KPerks.h5  not found (perhaps not annotated). If training on cropped data, make sure to call `cropimagesandlabels` prior to creating the dataset.
/Users/kperks/Documents/Wesleyan_Research/DLC_data/GroupFish/GroupFish-KPerks-2020-06-15/labeled-data/GroupFish3_compressed_cropped_cropped/CollectedData_KPerks.h5  not found (perhaps not annotated). If training on cropped data, make sure to call `cropimagesandlabels` prior to creating the dataset.
/Users/kperks/Documents/Wesleyan_Research/DLC_data/GroupFish/GroupFish-KPerks-2020-06-15/labeled-data/GroupFish2_compressed_cropped_cropped/CollectedData_KPerks.h5  not found (perhaps not annotated). If training on cropped data, make sure to call `cropimagesandlabels` prior to creating the dataset.
Annotation data was not found by splitting video paths (from config['video_sets']). An alternative route is taken...
The following folders were found: ['/Users/kperks/Documents/Wesleyan_Research/DLC_data/GroupFish/GroupFish-KPerks-2020-06-15/labeled-data/GroupFish3_compressed_cropped', '/Users/kperks/Documents/Wesleyan_Research/DLC_data/GroupFish/GroupFish-KPerks-2020-06-15/labeled-data/GroupFish1_dnsampled_cropped', '/Users/kperks/Documents/Wesleyan_Research/DLC_data/GroupFish/GroupFish-KPerks-2020-06-15/labeled-data/GroupFish4_compressed_cropped', '/Users/kperks/Documents/Wesleyan_Research/DLC_data/GroupFish/GroupFish-KPerks-2020-06-15/labeled-data/GroupFish2_compressed_cropped']
Utilizing the following graph: [[0, 1], [1, 2], [1, 3], [1, 4], [2, 4], [2, 3], [0, 4], [0, 3], [3, 4], [0, 2]]
Creating training data for  1 0.95]

Then to train the network (this is a multi-animal project so I reduced save and max iters).

[deeplabcut.train_network(config_path,saveiters=10000,maxiters=50000)]

However, when I went to train the network I got an error about the pickle file not existing.
Although dlc-models/iteration-0/[project_name][date]trainset95shuffle1/train was created, and there is a pose_cfg.yaml file in it, there is no pickle file here.
I DO see a pickle file in the iteration-0 subfolder created under training-datasets:
training-datasets/iteration-0/UnaugmentedData[etc]/GroupFish_KPerks95shuffle1.pickle
In addition, there are 3 other files in UnaugmentedDatea[etc]: CollectedData_KPerks.csv, CollectedData_KPerks.h5, Documentation_data-GroupFish_95shuffle1.pickle.

Specifically, the error from the train_network command is this:

Code input

[Activating limb prediction...
Starting with multi-animal imaug + adam pose-dataset loader.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/pose_estimation_tensorflow/training.py", line 193, in train_network
    raise e
  File "/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/pose_estimation_tensorflow/training.py", line 176, in train_network
    allow_growth=allow_growth,
  File "/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/pose_estimation_tensorflow/train_multianimal.py", line 137, in train
    dataset = create_dataset(cfg)
  File "/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/pose_estimation_tensorflow/dataset/factory.py", line 56, in create
    data = MAPoseDataset(cfg)
  File "/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/pose_estimation_tensorflow/dataset/pose_multianimal_imgaug.py", line 34, in __init__
    self.data = self.load_dataset()
  File "/anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/pose_estimation_tensorflow/dataset/pose_multianimal_imgaug.py", line 42, in load_dataset
    with open(os.path.join(self.cfg.project_path, file_name), "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'training-datasets/iteration-0/UnaugmentedDataSet_GroupFishJun15/GroupFish_KPerks95shuffle1.pickle']

I copied the 4 files from training-datasets/iteration-0/UnaugmentedData[etc]/ to dlc-models/iteration-0/[project_name][date]trainset95shuffle1/train/ and tried to train again:

Code input

[deeplabcut.train_network(config_path,saveiters=10000,maxiters=50000)]

The output got to the stage of "Starting multi-animal training" but needing to copy and paste those files seems like something that should not need to happen.
Is there something that I am missing or misplacing that is preventing the file structure from being generated correctly?

Thank you for your help!

-Krista Perks
(working on tracking multiple weakly electric fish for studying electrocommunication behavior)

If it is helpful, here is the pose_cfg.yaml that was created and did end up automatically in the dlc-models///train subdirectory:

pose_cfg.yaml

[all_joints:
- - 0
- - 1
- - 2
- - 3
- - 4
all_joints_names:
- head
- finL
- finR
- tail_attach
- tail_tip
batch_size: 8
bottomheight: 400
crop: true
cropratio: 0.4
dataset: training-datasets/iteration-0/UnaugmentedDataSet_GroupFishJun15/GroupFish_KPerks95shuffle1.pickle
dataset_type: multi-animal-imgaug
display_iters: 500
global_scale: 0.8
init_weights: /anaconda3/envs/DLC-CPU/lib/python3.7/site-packages/deeplabcut/pose_estimation_tensorflow/models/pretrained/resnet_v1_50.ckpt
intermediate_supervision: false
intermediate_supervision_layer: 12
leftwidth: 400
location_refinement: true
locref_huber_loss: true
locref_loss_weight: 0.05
locref_stdev: 7.2801
max_input_size: 1500
metadataset: training-datasets/iteration-0/UnaugmentedDataSet_GroupFishJun15/Documentation_data-GroupFish_95shuffle1.pickle
min_input_size: 64
minsize: 100
mirror: false
multi_step:
- - 0.0001
  - 7500
- - 5.0e-05
  - 12000
- - 1.0e-05
  - 200000
net_type: resnet_50
num_joints: 5
num_limbs: 10
optimizer: adam
pafwidth: 20
pairwise_huber_loss: false
pairwise_loss_weight: 0.1
pairwise_predict: false
partaffinityfield_graph:
- - 0
  - 1
- - 1
  - 2
- - 1
  - 3
- - 1
  - 4
- - 2
  - 4
- - 2
  - 3
- - 0
  - 4
- - 0
  - 3
- - 3
  - 4
- - 0
  - 2
partaffinityfield_predict: true
pos_dist_thresh: 17
project_path: /Users/kperks/Documents/Wesleyan_Research/DLC_data/GroupFish/GroupFish-KPerks-2020-06-15
rightwidth: 400
save_iters: 10000
scale_jitter_lo: 0.5
scale_jitter_up: 1.25
topheight: 400
weigh_only_present_joints: false]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions