Commit ca550eae authored by Jonas Müller's avatar Jonas Müller

resume training

parent 6fae04ee
......@@ -28,6 +28,7 @@ parser.add_option("--network", dest="network", help="Base network to use. Suppor
parser.add_option("--hf", dest="horizontal_flips", help="Augment with horizontal flips in training. (Default=false).", action="store_true", default=False)
parser.add_option("--vf", dest="vertical_flips", help="Augment with vertical flips in training. (Default=false).", action="store_true", default=False)
parser.add_option("--remote", dest="remote", help="Set for remote execution", action="store_true", default=False)
parser.add_option("--resume", dest="resume", help="Set for resume the training", action="store_true", default=False)
parser.add_option("--rot", "--rot_90", dest="rot_90", help="Augment with 90 degree rotations in training. (Default=false).",
action="store_true", default=False)
parser.add_option("--num_epochs", type="int", dest="num_epochs", help="Number of epochs.", default=2000)
......@@ -143,6 +144,13 @@ except:
print('Could not load pretrained model weights. Weights can be found in the keras application folder \')
if options.resume:
print('Try to resume training.')
model_rpn.load_weights(C.model_path, by_name=True)
print('Loaded RPN weights')
model_classifier.load_weights(C.model_path, by_name=True)
print('Loaded Classifier weights')
optimizer = Adam(lr=1e-5)
optimizer_classifier = Adam(lr=1e-5)
model_rpn.compile(optimizer=optimizer, loss=[losses.rpn_loss_cls(num_anchors), losses.rpn_loss_regr(num_anchors)])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment