Skip to content

Commit

Permalink
Do not eval after the initial epoch.
Browse files Browse the repository at this point in the history
  • Loading branch information
zmgong committed Jul 19, 2024
1 parent a03227b commit dcdc0fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/train_cl.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def main_process(rank: int, world_size: int, args):
else:
train_epoch(args.activate_wandb, args.model_config.epochs, epoch, pre_train_dataloader, model, optimizer,
criterion, device, open_clip_ver=open_clip_ver, rank=rank)
if epoch % args.model_config.evaluation_period == 0 or epoch == args.model_config.epochs - 1 and rank == 0:
if (epoch % args.model_config.evaluation_period == 0 or epoch == args.model_config.epochs - 1) and rank == 0 and epoch != 0:
if hasattr(args.model_config, 'dataset') and args.model_config.dataset == "INSECT":
acc_dict, pred_dict = eval_phase(model, device, insect_train_dataloader_for_key, insect_val_dataloader,
insect_test_seen_dataloader, insect_test_unseen_dataloader, k_list)
Expand Down

0 comments on commit dcdc0fa

Please sign in to comment.