From 10e3f9fad8b4f2eb7c568edee959cd75d63f310d Mon Sep 17 00:00:00 2001 From: s444417 Date: Mon, 25 Apr 2022 22:09:52 +0200 Subject: [PATCH] save model --- Dockerfile | 6 +++--- src/trainScript.py | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d294dd2..6f734ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,10 @@ WORKDIR /app COPY . . -RUN ls -la - RUN chmod o+wrx ./startscript1.sh RUN chmod o+wrx ./runPythonScripts.sh -RUN ./startscript1.sh \ No newline at end of file +RUN ./startscript1.sh + +RUN ls -la diff --git a/src/trainScript.py b/src/trainScript.py index 6a62d65..05a2799 100644 --- a/src/trainScript.py +++ b/src/trainScript.py @@ -56,10 +56,13 @@ linear_model.compile(loss = tf.losses.MeanSquaredError(), optimizer = tf.optimizers.Adam(1)) # train model -history = linear_model.fit(house_price_features, house_price_labels, epochs=10, ) +history = linear_model.fit(house_price_features, house_price_labels, epochs=5, ) #callbacks=[cp_callback]) # print(history) +# save model +linear_model.save('saved_model/my_model') + test_results = {} test_results['linear_model'] = linear_model.evaluate( house_price_test_features, house_price_test_expected, verbose=0)