Skip to content

Commit

Permalink
bugfix on takeweightsfrom option
Browse files Browse the repository at this point in the history
  • Loading branch information
jkiesele committed Jan 23, 2022
1 parent a112aff commit a5df438
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions training/training_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(
useweights=False, testrun=False,
testrun_fraction=0.1,
resumeSilently=False,
renewtokens=True,
renewtokens=False,
collection_class=DataCollection,
parser=None,
recreate_silently=False
Expand Down Expand Up @@ -241,11 +241,9 @@ def setModel(self,model,**modelargs):
self.keras_model.build(None)

if len(self.keras_weight_model_path):
from DeepJetCore.modeltools import apply_weights_where_possible
tbcopy = self
tbcopy.loadModel(self.keras_weight_model_path)
from DeepJetCore.modeltools import apply_weights_where_possible, load_model
self.keras_model = apply_weights_where_possible(self.keras_model,
tbcopy.keras_model)
load_model(self.keras_weight_model_path))
#try:
# self.keras_model=model(self.keras_inputs,**modelargs)
#except BaseException as e:
Expand Down Expand Up @@ -358,7 +356,7 @@ def _initTraining(self,
from _thread import start_new_thread

if self.renewtokens:
print('starting afs backgrounder')
print('afs backgrounder has proven to be unreliable, use with care')
checkTokens()
start_new_thread(renew_token_process,())

Expand Down

0 comments on commit a5df438

Please sign in to comment.