Browse Source

added load_path argument. fixed a minor bug

Dimitri Korsch 4 years ago
parent
commit
0c264c5665
2 changed files with 5 additions and 5 deletions
  1. 2 5
      cvfinetune/finetuner/base.py
  2. 3 0
      cvfinetune/parser/model_args.py

+ 2 - 5
cvfinetune/finetuner/base.py

@@ -155,6 +155,7 @@ class _ModelMixin(abc.ABC):
 			kwargs = dict(
 				weights=self.weights,
 				strict=args.load_strict,
+				path=args.load_path,
 				headless=args.headless,
 			)
 			loader = partial(loader_func, **kwargs)
@@ -306,7 +307,7 @@ class _TrainerMixin(abc.ABC):
 
 		self.evaluator.default_name = default_name
 
-	def _new_trainer(self, trainer_cls, *args, **kwargs):
+	def _new_trainer(self, trainer_cls, opts, *args, **kwargs):
 		return trainer_cls(
 			opts=opts,
 			updater=self.updater,
@@ -314,10 +315,6 @@ class _TrainerMixin(abc.ABC):
 			*args, **kwargs
 		)
 
-	def evaluate(self, trainer_cls, opts, *args, *kwargs):
-		trainer = self._new_trainer(trainer_cls, opts, *args, **kwargs)
-		return self.evaluator.evaluate(trainer)
-
 	def run(self, trainer_cls, opts, *args, **kwargs):
 
 		trainer = self._new_trainer(trainer_cls, opts, *args, **kwargs)

+ 3 - 0
cvfinetune/parser/model_args.py

@@ -45,6 +45,9 @@ def add_model_args(parser):
 
 		Arg("--load_strict", action="store_true",
 			help="load weights in a strict mode"),
+
+		Arg("--load_path", type=str,
+			help="load path within the weights archive"),
 	]
 
 	parser.add_args(_args, group_name="Model arguments")