diff --git a/examples/v1-client-tensorflow-mnist-classifier/demo.ipynb b/examples/v1-client-tensorflow-mnist-classifier/demo.ipynb index 198f29056..4e9351c7a 100644 --- a/examples/v1-client-tensorflow-mnist-classifier/demo.ipynb +++ b/examples/v1-client-tensorflow-mnist-classifier/demo.ipynb @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 12, "metadata": { "tags": [] }, @@ -53,7 +53,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -176,7 +176,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": { "tags": [] }, @@ -194,9 +194,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "{'username': 'pluginuser', 'status': 'Login successful'}" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "try:\n", " client.users.create('pluginuser','pluginuser@dioptra.nccoe.nist.gov','pleasemakesuretoPLUGINthecomputer','pleasemakesuretoPLUGINthecomputer')\n", @@ -214,7 +225,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -252,7 +263,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": { "scrolled": true, "tags": [] @@ -492,7 +503,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -516,7 +527,7 @@ }, { "cell_type": "code", - "execution_count": 130, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -544,7 +555,7 @@ }, { "cell_type": "code", - "execution_count": 131, + "execution_count": 32, "metadata": { "scrolled": true }, @@ -575,7 +586,7 @@ }, { "cell_type": "code", - "execution_count": 132, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -613,7 +624,7 @@ }, { "cell_type": "code", - "execution_count": 133, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -642,23 +653,25 @@ }, { "cell_type": "code", - "execution_count": 139, + "execution_count": 31, "metadata": {}, "outputs": [ { - "ename": "AttributeError", - "evalue": "'JobsClient' object has no attribute 'get_mlflow_run_id'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[139], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mclient\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mjobs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_mlflow_run_id\u001b[49m(infer_job[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mid\u001b[39m\u001b[38;5;124m'\u001b[39m])\n", - "\u001b[0;31mAttributeError\u001b[0m: 'JobsClient' object has no attribute 'get_mlflow_run_id'" + "name": "stdout", + "output_type": "stream", + "text": [ + "bfac3e7023404ff6a6312ae8da2e0826\n", + "{'compile_metrics': 0.5866386294364929, 'loss': 0.9697718620300293}\n" ] } ], "source": [ - "client.jobs.get_mlflow_run_id(infer_job['id'])" + "from mlflow.tracking import MlflowClient\n", + "mlflow_client = MlflowClient()\n", + "mlflow_runid = client.jobs.get_mlflow_run_id(infer_job['id'])['mlflowRunId'].replace('-','') # why\n", + "print(mlflow_runid)\n", + "mlflow_run = mlflow_client.get_run(mlflow_runid)\n", + "pprint.pprint(mlflow_run.data.metrics)" ] }, {