Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Some missing code for evaluation #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from utils.costom_logger import timeLogger
from utils.config_utils import load_yaml, build_record_folder, get_args
from utils.lr_schedule import cosine_decay, adjust_lr, get_lr
from eval import evaluate, cal_train_metrics
from eval import evaluate, cal_train_metrics, eval_and_save

warnings.simplefilter("ignore")

Expand Down Expand Up @@ -75,7 +75,7 @@ def set_environment(args, tlogger):
"""

if train_loader is None:
return train_loader, val_loader, model, None, None, None, None
return train_loader, val_loader, model, None, None, None, None, 0

### = = = = Optimizer = = = =
tlogger.print("Building Optimizer....")
Expand Down Expand Up @@ -249,8 +249,7 @@ def main(args, tlogger):
train(args, epoch, model, scaler, amp_context, optimizer, schedule, train_loader)
tlogger.print()
else:
from eval import eval_and_save
eval_and_save(args, model, val_loader)
eval_and_save(args, model, val_loader, tlogger)
break

eval_freq_schedule(args, epoch)
Expand Down