aboutsummaryrefslogtreecommitdiff
path: root/libs/utils.py
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2022-07-14 16:21:31 +0800
committerJordan Gong <jordan.gong@protonmail.com>2022-07-14 16:21:31 +0800
commit377d3d189eea1a068d65f8918a2b7fbc7d1a1977 (patch)
tree9988776c286e87443be7bedcca0014bcce5df84e /libs/utils.py
parent7246e6b698f12bc70004c0a4c7a1a8641573cd10 (diff)
Make class variables available for `_custom_init_fn`
Diffstat (limited to 'libs/utils.py')
-rw-r--r--libs/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/utils.py b/libs/utils.py
index bc45a12..5e8529b 100644
--- a/libs/utils.py
+++ b/libs/utils.py
@@ -93,8 +93,6 @@ class Trainer(ABC):
optims.items(), last_iter, num_iters, config.sched_config,
))
- self._custom_init_fn(config)
-
self.restore_iter = last_iter + 1
self.train_loader = train_loader
self.test_loader = test_loader
@@ -104,6 +102,8 @@ class Trainer(ABC):
self._inf_mode = inf_mode
self._checkpoint_dir = checkpoint_dir
+ self._custom_init_fn(config)
+
@dataclass
class BatchLogRecord(BaseBatchLogRecord):
pass