We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f37d20 commit d0036faCopy full SHA for d0036fa
lightning_pose/train.py
@@ -1,8 +1,11 @@
1
"""Example model training function."""
2
3
import os
4
+import random
5
6
import lightning.pytorch as pl
7
+import numpy as np
8
+import torch
9
from omegaconf import DictConfig, ListConfig, OmegaConf, open_dict
10
from typeguard import typechecked
11
@@ -32,6 +35,15 @@
32
35
@typechecked
33
36
def train(cfg: DictConfig) -> None:
34
37
38
+ # reset all seeds
39
+ seed = 0
40
+ os.environ["PYTHONHASHSEED"] = str(seed)
41
+ torch.manual_seed(seed)
42
+ np.random.seed(seed)
43
+ random.seed(seed)
44
+ torch.backends.cudnn.benchmark = False
45
+ torch.backends.cudnn.deterministic = True
46
+
47
# record lightning-pose version
48
from lightning_pose import __version__ as lightning_pose_version
49
with open_dict(cfg):
0 commit comments