standalone val (#56)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -19,6 +19,13 @@ class ClassificationTrainer(BaseTrainer):
|
||||
else:
|
||||
model = ClassificationModel(model_cfg, weights, data["nc"])
|
||||
ClassificationModel.reshape_outputs(model, data["nc"])
|
||||
for m in model.modules():
|
||||
if not weights and hasattr(m, 'reset_parameters'):
|
||||
m.reset_parameters()
|
||||
if isinstance(m, torch.nn.Dropout) and self.args.dropout is not None:
|
||||
m.p = self.args.dropout # set dropout
|
||||
for p in model.parameters():
|
||||
p.requires_grad = True # for training
|
||||
return model
|
||||
|
||||
def get_dataloader(self, dataset_path, batch_size, rank=0, mode="train"):
|
||||
|
||||
Reference in New Issue
Block a user