# HG changeset patch # User Laman # Date 2019-05-05 16:58:38 # Node ID 5fb721461494b4771e2c6e711e46def42a52d0d9 # Parent 9483b964f560dcfe795fe608de2e39e5e919aca4 minor fixes diff --git a/exp/kerokero/ftp.py b/exp/kerokero/ftp.py --- a/exp/kerokero/ftp.py +++ b/exp/kerokero/ftp.py @@ -9,7 +9,7 @@ with open(os.path.join(thisDir,"ftp.json def push(path): - ftp=ftplib.FTP() + ftp=ftplib.FTP_TLS() ftp.connect(cfg["host"],cfg["port"]) ftp.login(cfg["user"],cfg["password"]) @@ -20,3 +20,7 @@ def push(path): ftp.storbinary("STOR "+filename,f) ftp.close() + + +if __name__=="__main__": + push(os.path.join(thisDir,"ftp.py")) diff --git a/exp/kerokero/train.py b/exp/kerokero/train.py --- a/exp/kerokero/train.py +++ b/exp/kerokero/train.py @@ -82,10 +82,10 @@ with np.load(args.data) as data: testLabels=data["testLabels"] log.info("done") -for i in range(args.initial_epoch,args.epochs//10): +for i in range(args.initial_epoch//10,args.epochs//10): model.fit(trainImages.reshape((-1,224,224,1)),trainLabels,epochs=(i+1)*10,initial_epoch=i*10,batch_size=128,validation_split=0.2) - path=args.save_model.format(i+1) + path=args.save_model.format((i+1)*10) log.info("saving model...") model.save(path) - ftp.push(path) + if i%2==1: ftp.push(path) log.info(model.evaluate(testImages,testLabels))