Using model.export() to save model instead of model.save() sa per latest 21/14921/1
authorashishj1729 <jain.ashish@samsung.com>
Tue, 16 Sep 2025 14:08:46 +0000 (19:38 +0530)
committerashishj1729 <jain.ashish@samsung.com>
Tue, 16 Sep 2025 14:12:49 +0000 (19:42 +0530)
tensorflow v2.20.0

Issue_id: AIMLFW-244
Change-Id: I32750f3d2db58153f3dfb9a50da75ee4ae60ab57
Signed-off-by: ashishj1729 <jain.ashish@samsung.com>
kf-pipelines/qoe-pipeline.ipynb

index edaf838..ea907a6 100644 (file)
@@ -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": [
     "    \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",
     "    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": [
   },
   {
    "cell_type": "code",
-   "execution_count": 5,
+   "execution_count": 23,
    "metadata": {},
    "outputs": [],
    "source": [
   },
   {
    "cell_type": "code",
-   "execution_count": 6,
+   "execution_count": 24,
    "metadata": {},
    "outputs": [
     {
        "<Response [200]>"
       ]
      },
-     "execution_count": 6,
+     "execution_count": 24,
      "metadata": {},
      "output_type": "execute_result"
     }