deeplabcut.pose_estimation_pytorch.utils
Functions:
| Name | Description |
|---|---|
fix_seeds |
Fixes the random seed for python, numpy and pytorch. |
resolve_device |
Determines which device should be used from the model config. |
fix_seeds
Fixes the random seed for python, numpy and pytorch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
int
|
the seed to set |
required |
Source code in deeplabcut/pose_estimation_pytorch/utils.py
resolve_device
Determines which device should be used from the model config.
When the device is set to 'auto': If an Nvidia GPU is available, selects the device as cuda:0. Selects 'mps' if available (on macOS) and the net type is compatible. Otherwise, returns 'cpu'. Otherwise, simply returns the selected device
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
PoseConfig | dict | str | Path
|
The PyTorch pose configuration. |
required |
Returns:
| Type | Description |
|---|---|
str
|
the device on which training should be run |