提交 df6ccb19 编写于 作者: M michaelowenliu

change eval_dataset to val_dataset

上级 53f1d1e4
...@@ -52,7 +52,7 @@ def loss_computation(logits, label, losses): ...@@ -52,7 +52,7 @@ def loss_computation(logits, label, losses):
def train(model, def train(model,
train_dataset, train_dataset,
places=None, places=None,
eval_dataset=None, val_dataset=None,
optimizer=None, optimizer=None,
save_dir='output', save_dir='output',
iters=10000, iters=10000,
...@@ -173,10 +173,10 @@ def train(model, ...@@ -173,10 +173,10 @@ def train(model,
paddle.save(optimizer.state_dict(), paddle.save(optimizer.state_dict(),
os.path.join(current_save_dir, 'model')) os.path.join(current_save_dir, 'model'))
if eval_dataset is not None: if val_dataset is not None:
mean_iou, avg_acc = evaluate( mean_iou, avg_acc = evaluate(
model, model,
eval_dataset, val_dataset,
model_dir=current_save_dir, model_dir=current_save_dir,
num_classes=num_classes, num_classes=num_classes,
ignore_index=ignore_index, ignore_index=ignore_index,
...@@ -188,7 +188,7 @@ def train(model, ...@@ -188,7 +188,7 @@ def train(model,
paddle.save(model.state_dict(), paddle.save(model.state_dict(),
os.path.join(best_model_dir, 'model')) os.path.join(best_model_dir, 'model'))
logger.info( logger.info(
'Current evaluated best model in eval_dataset is iter_{}, miou={:4f}' 'Current evaluated best model in val_dataset is iter_{}, miou={:4f}'
.format(best_model_iter, best_mean_iou)) .format(best_model_iter, best_mean_iou))
if use_vdl: if use_vdl:
......
...@@ -121,7 +121,7 @@ def main(args): ...@@ -121,7 +121,7 @@ def main(args):
cfg.model, cfg.model,
train_dataset, train_dataset,
places=places, places=places,
eval_dataset=val_dataset, val_dataset=val_dataset,
optimizer=cfg.optimizer, optimizer=cfg.optimizer,
save_dir=args.save_dir, save_dir=args.save_dir,
iters=cfg.iters, iters=cfg.iters,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册