Closed symoon94 closed 4 years ago
def bind_model(model): def load(save_folder, **kwargs): model = keras.models.load_model(os.path.join(save_folder, 'test.h5')) def save(save_folder, **kwargs): model.save(os.path.join(save_folder, 'test.h5')) def infer(data_path, **kwargs): return inference(model, data_path) nsml.bind(save=save, load=load, infer=infer)
main() 안에는 다음과 같이 작성하였습니다.
WEIGHT_FILE = "test.h5" model = tf.keras.models.load_model(WEIGHT_FILE) logger.info(f"Model Summary\n{model.summary()}") nu.bind_model(model) nsml.save('example') if args.pause: nsml.paused(scope=locals()) if args.mode == 'test': nsml.load('example', session=args.sess_name) logger.info("FINAL Model Summary") logger.info(f"{model.summary()}")
session: t0048/tr-2/198
main() 안에는 다음과 같이 작성하였습니다.