Deeplabcut Training Colab

Hi

I am using Deeplabcut DLC-CPU. Since that my computer will take several days to perform the training network i am using Colab too.

However, when i run the training:

path_config_file = ‘/content/drive/My Drive/App/demo-julia-2020-05-17/config.yaml’
deeplabcut.train_network(path_config_file, shuffle=1, displayiters=10, saveiters=100)

The following error appear:

FileNotFoundError Traceback (most recent call last)
in ()
----> 1 deeplabcut.train_network(path_config_file, shuffle=1, displayiters=10, saveiters=100)

1 frames
/usr/local/lib/python3.6/dist-packages/deeplabcut/utils/auxiliaryfunctions.py in read_config(configname)
130 else:
131 raise FileNotFoundError(
–> 132 “Config file is not found. Please make sure that the file exists and/or that you passed the path of the config file correctly!”)
133 return (cfg)
134

FileNotFoundError: Config file is not found. Please make sure that the file exists and/or that you passed the path of the config file correctly!

I check the path and the file is in the folder indicated in the path.

How can i fix this issue?
Please take a lool on the print screens.

HI @Julia_Pinho - did you update the “project_path” on your project to reflect the directory you have your project in on google drive?

i.e, you need to just edit this:
Screen Shot 2020-05-17 at 11.48.53 AM

to be:

/content/drive/My Drive/App/demo-julia-2020-05-17

I created the project in the google drive.
In colab the first comand is this path.

However i add the code that you suggested:
project_path = ‘\content\drive\My Drive\App\demo-julia-2020-05-17’
project_path

path_config_file = ‘\content\drive\My Drive\App\demo-julia-2020-05-17\config.yaml’
path_config_file

deeplabcut.train_network(path_config_file, shuffle=1, displayiters=10, saveiters=100)

the output:

FileNotFoundError Traceback (most recent call last)
in ()
----> 1 deeplabcut.train_network(path_config_file, shuffle=1, displayiters=10, saveiters=100)

1 frames
/usr/local/lib/python3.6/dist-packages/deeplabcut/utils/auxiliaryfunctions.py in read_config(configname)
130 else:
131 raise FileNotFoundError(
–> 132 “Config file is not found. Please make sure that the file exists and/or that you passed the path of the config file correctly!”)
133 return (cfg)
134

FileNotFoundError: Config file is not found. Please make sure that the file exists and/or that you passed the path of the config file correctly!

Hi Julia, I am confused; how did you label your data? Most people have a local CPU only DLC installed, then move the folder to colab. Inside the config.yaml that is created in the project folder, that is where you edit the proejct path -> check this out: https://github.com/AlexEMG/DeepLabCut/blob/f2f69166bb11e37fa9784273191468362f9c699d/examples/COLAB_YOURDATA_TrainNetwork_VideoAnalysis.ipynb

and these videos: https://www.youtube.com/playlist?list=PLjpMSEOb9vRFwwgIkLLN1NmJxFprkO_zi

and you paths are incorrectly formatted; (see my above answer)

project_path = ‘\content\drive\My Drive\App\demo-julia-2020-05-17’
project_path

path_config_file = ‘\content\drive\My Drive\App\demo-julia-2020-05-17\config.yaml’
path_config_file

but there are other issues as well, i.e. you need to make the training set on colab, etc. please see the tutorials.

Hi,

Sorry if I was not clear. I will try explain better my error.
First I open deeplabcut in my in windows:
cd C:/Users/paulo/Desktop/DeepLabCut-master/conda-environments
conda ativate DLC-CPU
ipython -m deeplabcut

then, i create a project and in the browse I select the directory where the project will be saved (I sellected my google drive installed in pauloComputer
C:\Users\paulo\Google Drive\App\demo-julia-2020-05-17\config.yaml)
then, i extracted the frames, labelled them and i create a training dataset…when the message “happy training” appears I switched to Colab.

I open this link:


then i pressed “open in colab”

change the runtime to GPU
Press play in !pip install deeplabcut
Restart runtime
I used tensor ("%tensorflow_version 1.x")
now it is time to link google drive:
from google.colab import drive
drive.mount(’/content/drive’)
I authorized the access
then i liked my project:
ProjectFolderName = ‘/content/drive/Mydrive/App/demo-julia-2020-05-17’
VideoType = ‘avi’
videofile_path = [’/content/drive/My Drive/App/demo-julia-2020-05-17/videos/’] #Enter the list of videos or folder to analyze.
videofile_path

import os
os.environ[“DLClight”]=“True”
import deeplabcut
deeplabcut.version
path_config_file = ‘/content/drive/My Drive/App/demo-julia-2020-05-17/config.yaml’
path_config_file
deeplabcut.create_training_dataset(path_config_file, net_type=‘resnet_50’, augmenter_type=‘imgaug’)

output error:
/content/drive/My Drive/App/demo-julia-2020-05-17/training-datasets/iteration-0/UnaugmentedDataSet_demoMay17 already exists!
/content/drive/My Drive/App/demo-julia-2020-05-17/labeled-data/C:\Users\paulo\Google Drive\App\demo-julia-2020-05-17\videos\7326/CollectedData_julia.h5 not found (perhaps not annotated)
/content/drive/My Drive/App/demo-julia-2020-05-17/labeled-data/C:\Users\paulo\Google Drive\App\demo-julia-2020-05-17\videos\7330/CollectedData_julia.h5 not found (perhaps not annotated)
/content/drive/My Drive/App/demo-julia-2020-05-17/labeled-data/C:\Users\paulo\Google Drive\App\demo-julia-2020-05-17\videos\7333/CollectedData_julia.h5 not found (perhaps not annotated)
/content/drive/My Drive/App/demo-julia-2020-05-17/labeled-data/C:\Users\paulo\Google Drive\App\demo-julia-2020-05-17\videos\7530/CollectedData_julia.h5 not found (perhaps not annotated)
/content/drive/My Drive/App/demo-julia-2020-05-17/labeled-data/C:\Users\paulo\Google Drive\App\demo-julia-2020-05-17\videos\7532/CollectedData_julia.h5 not found (perhaps not annotated)
Annotation data was not found by splitting video paths (from config[‘video_sets’]). An alternative route is taken…
The following folders were found: [‘7532’, ‘7326’, ‘7333’, ‘7530’, ‘7330’]

KeyboardInterrupt Traceback (most recent call last)
in ()
2 #Then, run this cell. There are many more functions you can set here, including which netowkr to use!
3 #check the docstring for full options you can do!
----> 4 deeplabcut.create_training_dataset(path_config_file, net_type=‘resnet_50’, augmenter_type=‘imgaug’)

7 frames
/usr/local/lib/python3.6/dist-packages/tables/file.py in init(self, filename, mode, title, root_uep, filters, **kwargs)
782
783 # Now, it is time to initialize the File extension
–> 784 self._g_new(filename, mode, **params)
785
786 # Check filters and set PyTables format version for new files.

KeyboardInterrupt:

Do you can help me to fix this, please?
Thanks in advance

It’s the paths. You need to edit the project path file inside the config.yaml.

Your local google drive folder is windows.

Colab is Linux.

This is why you need to (1) always create the training dataset on Colab, (2) you need to edit the project path and fix the \ to be / (see my above answers).

You can see the error here:

/content/drive/My Drive/App/demo-julia-2020-05-17/labeled-data/C:\Users\paulo\Google Drive\App\demo-julia-2020-05-17\videos\7326/CollectedData_julia.h5

It is fixed.

  1. i created the project in local
  2. Changed the path of the project and annotation of videos to the cloud locationin config.yaml
  3. created the training im the cloud
  4. correct / \

It is running the training
Thanks for the support

1 Like