@@ -99,7 +99,7 @@ def __init__(self, device: str = "gpu",
99
99
# we need to switch to eval mode here because by default it's in `train` mode.
100
100
# But in case of `interact/build_model` usage, we need to have model in eval mode.
101
101
self .model .eval ()
102
- log .info (f"Model was successfully initialized! Model summary:\n { self .model } " )
102
+ log .debug (f"Model was successfully initialized! Model summary:\n { self .model } " )
103
103
104
104
def init_from_opt (self , model_func : str ) -> None :
105
105
"""Initialize from scratch `self.model` with the architecture built in `model_func` method of this class
@@ -150,22 +150,22 @@ def load(self, fname: Optional[str] = None, *args, **kwargs) -> None:
150
150
model_func = getattr (self , self .opt .get ("model_name" , "" ), None )
151
151
152
152
if self .load_path :
153
- log .info (f"Load path { self .load_path } is given." )
153
+ log .debug (f"Load path { self .load_path } is given." )
154
154
if isinstance (self .load_path , Path ) and not self .load_path .parent .is_dir ():
155
155
raise ConfigError ("Provided load path is incorrect!" )
156
156
157
157
weights_path = Path (self .load_path .resolve ())
158
158
weights_path = weights_path .with_suffix (f".pth.tar" )
159
159
if weights_path .exists ():
160
- log .info (f"Load path { weights_path } exists." )
161
- log .info (f"Initializing `{ self .__class__ .__name__ } ` from saved." )
160
+ log .debug (f"Load path { weights_path } exists." )
161
+ log .debug (f"Initializing `{ self .__class__ .__name__ } ` from saved." )
162
162
163
163
# firstly, initialize with random weights and previously saved parameters
164
164
if model_func :
165
165
self .init_from_opt (model_func )
166
166
167
167
# now load the weights, optimizer from saved
168
- log .info (f"Loading weights from { weights_path } ." )
168
+ log .debug (f"Loading weights from { weights_path } ." )
169
169
checkpoint = torch .load (weights_path , map_location = self .device )
170
170
model_state = checkpoint ["model_state_dict" ]
171
171
optimizer_state = checkpoint ["optimizer_state_dict" ]
@@ -181,10 +181,10 @@ def load(self, fname: Optional[str] = None, *args, **kwargs) -> None:
181
181
self .optimizer .load_state_dict (optimizer_state )
182
182
self .epochs_done = checkpoint .get ("epochs_done" , 0 )
183
183
elif model_func :
184
- log .info (f"Init from scratch. Load path { weights_path } does not exist." )
184
+ log .debug (f"Init from scratch. Load path { weights_path } does not exist." )
185
185
self .init_from_opt (model_func )
186
186
elif model_func :
187
- log .info (f"Init from scratch. Load path { self .load_path } is not provided." )
187
+ log .debug (f"Init from scratch. Load path { self .load_path } is not provided." )
188
188
self .init_from_opt (model_func )
189
189
190
190
@overrides
0 commit comments