deeplabcut.pose_estimation_tensorflow.training
Functions:
| Name | Description |
|---|---|
return_train_network_path |
Returns the training and test pose config file names as well as the folder where |
train_network |
Trains the network with the labels in the training dataset. |
return_train_network_path
Returns the training and test pose config file names as well as the folder where the snapshot is.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
string
|
Full path of the config.yaml file as a string. |
required |
|
int
|
Integer value specifying the shuffle index to select for training. |
1
|
|
int
|
Which TrainingsetFraction to use. By default the first (TrainingFraction is a list in config.yaml). Defaults to 0. |
0
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
trainposeconfigfile, testposeconfigfile, snapshotfolder. |
Source code in deeplabcut/pose_estimation_tensorflow/training.py
train_network
train_network(
config,
shuffle=1,
trainingsetindex=0,
max_snapshots_to_keep=5,
displayiters=None,
saveiters=None,
maxiters=None,
allow_growth=True,
gputouse=None,
autotune=False,
keepdeconvweights=True,
modelprefix="",
superanimal_name="",
superanimal_transfer_learning=False,
)
Trains the network with the labels in the training dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
string
|
Full path of the config.yaml file as a string. |
required |
|
int
|
Integer value specifying the shuffle index to select for training. Defaults to 1. |
1
|
|
int
|
Integer specifying which TrainingsetFraction to use. Note that TrainingFraction is a list in config.yaml. Defaults to 0. |
0
|
|
int or None
|
Sets how many snapshots are kept, i.e. states of the trained network. Every
saving iteration many times a snapshot is stored, however only the last
|
5
|
|
int
|
This variable is actually set in |
required |
|
int
|
This variable is actually set in |
None
|
|
int
|
This variable is actually set in |
None
|
|
bool
|
For some smaller GPUs the memory issues happen. If |
True
|
|
int
|
Natural number indicating the number of your GPU (see number in nvidia-smi). If you do not have a GPU put None. See: https://nvidia.custhelp.com/app/answers/detail/a_id/3751/~/useful-nvidia-smi-queries. Defaults to None. |
None
|
|
bool
|
Property of TensorFlow, somehow faster if |
False
|
|
bool
|
Restores deconvolution layer (and backbone) weights when training from a snapshot. Set to false if bodypart count changes. Defaults to True. |
True
|
|
str
|
Directory containing the deeplabcut models to use when evaluating the network. By default, the models are assumed to exist in the project folder. Defaults to "". |
''
|
|
str
|
Specified if transfer learning with superanimal is desired. Defaults to "". |
''
|
|
bool
|
If true, transfer learning (new decoding layer). If false and superanimal_name is set, fine-tuning (reuse decoding layer). Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
|
None |
Examples:
To train the network for first shuffle of the training dataset
deeplabcut.train_network("/analysis/project/reaching-task/config.yaml")
To train the network for second shuffle of the training dataset
deeplabcut.train_network(
'/analysis/project/reaching-task/config.yaml',
shuffle=2,
keepdeconvweights=True,
)
Source code in deeplabcut/pose_estimation_tensorflow/training.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |