From: ashishj1729 Date: Tue, 16 Sep 2025 14:08:46 +0000 (+0530) Subject: Using model.export() to save model instead of model.save() sa per latest X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=f43509c332004708525ba1df4f48edb4fefeefcb;p=portal%2Faiml-dashboard.git Using model.export() to save model instead of model.save() sa per latest tensorflow v2.20.0 Issue_id: AIMLFW-244 Change-Id: I32750f3d2db58153f3dfb9a50da75ee4ae60ab57 Signed-off-by: ashishj1729 --- diff --git a/kf-pipelines/qoe-pipeline.ipynb b/kf-pipelines/qoe-pipeline.ipynb index edaf838..ea907a6 100644 --- a/kf-pipelines/qoe-pipeline.ipynb +++ b/kf-pipelines/qoe-pipeline.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -15,7 +15,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -98,13 +98,15 @@ " \n", " xx = y\n", " yy = yhat\n", - " model.save(\"./\")\n", + " model_save_filepath = \"./\"\n", + " model.export(model_save_filepath)\n", + " \n", " import json\n", " data = {}\n", " data['metrics'] = []\n", " data['metrics'].append({'Accuracy': str(np.mean(np.absolute(np.asarray(xx)-np.asarray(yy))<5))})\n", " \n", - "# as new artifact after training will always be 1.0.0\n", + " #as new artifact after training will always be 1.0.0\n", " artifactversion=\"1.0.0\"\n", " url = f\"http://modelmgmtservice.traininghost:8082/ai-ml-model-registration/v1/model-registrations/updateArtifact/{modelname}/{modelversion}/{artifactversion}\"\n", " updated_model_info= requests.post(url).json()\n", @@ -114,13 +116,13 @@ " trainingjob_id = featurepath.split('_')[-1]\n", " mm_sdk.upload_metrics(data, trainingjob_id)\n", " print(\"Model-metric : \", mm_sdk.get_metrics(trainingjob_id))\n", - " mm_sdk.upload_model(\"./\", modelname, modelversion, artifactversion)\n", + " mm_sdk.upload_model(model_save_filepath, modelname, modelversion, artifactversion)\n", " " ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -138,7 +140,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -151,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 24, "metadata": {}, "outputs": [ { @@ -160,7 +162,7 @@ "" ] }, - "execution_count": 6, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" }