Auto-select latest iteration of model
This commit is contained in:
parent
0a02422733
commit
f3ac903555
1 changed files with 5 additions and 1 deletions
|
@ -192,8 +192,12 @@ class PredictionServer:
|
||||||
eval_scene = eval_env.scenes[scene_idx]
|
eval_scene = eval_env.scenes[scene_idx]
|
||||||
online_env = create_online_env(eval_env, hyperparams, scene_idx, init_timestep)
|
online_env = create_online_env(eval_env, hyperparams, scene_idx, init_timestep)
|
||||||
|
|
||||||
|
# auto-find highest iteration
|
||||||
model_registrar = ModelRegistrar(self.config.model_dir, self.config.eval_device)
|
model_registrar = ModelRegistrar(self.config.model_dir, self.config.eval_device)
|
||||||
model_registrar.load_models(iter_num=100)
|
model_iterations = pathlib.Path(self.config.model_dir).glob('model_registrar-*.pt')
|
||||||
|
highest_iter = max([int(p.stem.split('-')[-1]) for p in model_iterations])
|
||||||
|
|
||||||
|
model_registrar.load_models(iter_num=highest_iter)
|
||||||
|
|
||||||
trajectron = OnlineTrajectron(model_registrar,
|
trajectron = OnlineTrajectron(model_registrar,
|
||||||
hyperparams,
|
hyperparams,
|
||||||
|
|
Loading…
Reference in a new issue