Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create training data when using labels from outside DLC #2572

Open
2 tasks done
DavidGill159 opened this issue May 1, 2024 · 0 comments
Open
2 tasks done
Assignees
Labels
backwards compatibility issues concerning prior to current versions

Comments

@DavidGill159
Copy link

DavidGill159 commented May 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Bug description

I run:
deeplabcut.create_training_dataset(path_to_config)

error returned:
FileNotFoundError: [Errno 2] No such file or directory: path-to-an-example-frame

  • Note: I am able to run DLC smoothly when labelling within DLC
  • My network and videos are stored on my local machine (C drive) - I have stored DLC networks here before with no issues.

Operating System

Windows 10

DeepLabCut version

2.3.9

DeepLabCut mode

single animal

Device type

NVIDIA GeForce RTX 4080 with Cuda 11.6

Steps To Reproduce

  1. created a DLC network within the DLC ipython terminal -> customised the config landmarks accordingly
  2. extracted frames -> deleted these frames from within the labeled-data folders and replaced them with my 3rd party frames (PNGs) and associated labeled-data CSVs
  3. ran the convertcsv2h5 function successfully, although I noticed the data structures within are called 'df_with_missing' instead of 'keypoints' as they are when producing the data in the DLC GUI.
  4. now trying to create training set with no success.

Relevant log output

FileNotFoundError                         Traceback (most recent call last)
Cell In[8], line 1
----> 1 deeplabcut.create_training_dataset('C:\\Users\\X48823DG\\DLC_lp_Baseline-DG-2024-04-30\\config.yaml', augmenter_type='imgaug')

File ~\anaconda3\envs\deeplabcut\lib\site-packages\deeplabcut\generate_training_dataset\trainingsetmanipulation.py:1029, in create_training_dataset(config, num_shuffles, Shuffles, windows2linux, userfeedback, trainIndices, testIndices, net_type, augmenter_type, posecfg_template, superanimal_name)
   1019 (
   1020     datafilename,
   1021     metadatafilename,
   1022 ) = auxiliaryfunctions.get_data_and_metadata_filenames(
   1023     trainingsetfolder, trainFraction, shuffle, cfg
   1024 )
   1026 ################################################################################
   1027 # Saving data file (convert to training file for deeper cut (*.mat))
   1028 ################################################################################
-> 1029 data, MatlabData = format_training_data(
   1030     Data, trainIndices, nbodyparts, project_path
   1031 )
   1032 sio.savemat(
   1033     os.path.join(project_path, datafilename), {"dataset": MatlabData}
   1034 )
   1036 ################################################################################
   1037 # Saving metadata (Pickle file)
   1038 ################################################################################

File ~\anaconda3\envs\deeplabcut\lib\site-packages\deeplabcut\generate_training_dataset\trainingsetmanipulation.py:696, in format_training_data(df, train_inds, nbodyparts, project_path)
    694 filename = df.index[i]
    695 data["image"] = filename
--> 696 img_shape = read_image_shape_fast(os.path.join(project_path, *filename))
    697 data["size"] = img_shape
    698 temp = df.iloc[i].values.reshape(-1, 2)

File ~\anaconda3\envs\deeplabcut\lib\site-packages\deeplabcut\generate_training_dataset\trainingsetmanipulation.py:678, in read_image_shape_fast(path)
    675 @lru_cache(maxsize=None)
    676 def read_image_shape_fast(path):
    677     # Blazing fast and does not load the image into memory
--> 678     with Image.open(path) as img:
    679         width, height = img.size
    680         return len(img.getbands()), height, width

File ~\anaconda3\envs\deeplabcut\lib\site-packages\PIL\Image.py:3277, in open(fp, mode, formats)
   3274     filename = os.path.realpath(os.fspath(fp))
   3276 if filename:
-> 3277     fp = builtins.open(filename, "rb")
   3278     exclusive_fp = True
   3280 try:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\X48823DG\\DLC_lp_Baseline-DG-2024-04-30\\labeled-data\\compressed_videoscamera_2_trial_1_2022-07-20-091246-0000\\img00000431.png'

Anything else?

No response

Code of Conduct

@MMathisLab MMathisLab added the backwards compatibility issues concerning prior to current versions label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards compatibility issues concerning prior to current versions
Projects
None yet
Development

No branches or pull requests

3 participants