Train_gen = Train_genC.Generator() Test_gen = Test_genC.Generator() # Build/Load the Model from DLTools.ModelWrapper import ModelWrapper from CaloDNN.Models import * from keras.layers import Merge # You can automatically load the latest previous training of this model. if TestDefaultParam("LoadPreviousModel") and not LoadModel and BuildModel: print "Looking for Previous Model to load." ModelName = Name if ECAL and HCAL: ModelName += "_Merged" MyModel = ModelWrapper(Name=ModelName, LoadPrevious=True, OutputBase=OutputBase) # You can load a previous model using "-L" option with the model directory. if LoadModel and BuildModel: print "Loading Model From:", LoadModel if LoadModel[-1] == "/": LoadModel = LoadModel[:-1] MyModel = ModelWrapper(Name=os.path.basename(LoadModel), InDir=os.path.dirname(LoadModel), OutputBase=OutputBase) MyModel.Load(LoadModel) if BuildModel and not MyModel.Model: FailedLoad = True else: FailedLoad = False