update --fixbase to --always-fixbase

pull/119/head
KaiyangZhou 2018-11-14 22:33:00 +00:00
parent 3a4e390c77
commit 61a1db566d
5 changed files with 6 additions and 6 deletions

View File

@ -86,8 +86,8 @@ def argument_parser():
parser.add_argument('--test-batch-size', default=100, type=int,
help="test batch size")
parser.add_argument('--fixbase', action='store_true',
help="always fix base network")
parser.add_argument('--always-fixbase', action='store_true',
help="always fix base network and only train specified layers")
parser.add_argument('--fixbase-epoch', type=int, default=0,
help="how many epochs to fix base network (only train randomly initialized classifier)")
parser.add_argument('--open-layers', type=str, nargs='+', default=['classifier'],

View File

@ -157,7 +157,7 @@ def train(epoch, model, criterion, optimizer, trainloader, use_gpu, fixbase=Fals
model.train()
if fixbase or args.fixbase:
if fixbase or args.always_fixbase:
open_specified_layers(model, args.open_layers)
else:
open_all_layers(model)

View File

@ -160,7 +160,7 @@ def train(epoch, model, criterion_xent, criterion_htri, optimizer, trainloader,
model.train()
if fixbase or args.fixbase:
if fixbase or args.always_fixbase:
open_specified_layers(model, args.open_layers)
else:
open_all_layers(model)

View File

@ -158,7 +158,7 @@ def train(epoch, model, criterion, optimizer, trainloader, use_gpu, fixbase=Fals
model.train()
if fixbase or args.fixbase:
if fixbase or args.always_fixbase:
open_specified_layers(model, args.open_layers)
else:
open_all_layers(model)

View File

@ -162,7 +162,7 @@ def train(epoch, model, criterion_xent, criterion_htri, optimizer, trainloader,
model.train()
if fixbase or args.fixbase:
if fixbase or args.always_fixbase:
open_specified_layers(model, args.open_layers)
else:
open_all_layers(model)