Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
hhsecond committed Dec 20, 2021
1 parent 81643d1 commit 999fef6
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions ImageClassificationWithPytorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 1,
"id": "1e657632",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -40,7 +40,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 2,
"id": "56edea97",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -69,7 +69,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 3,
"id": "59b6599a",
"metadata": {},
"outputs": [
Expand All @@ -79,7 +79,7 @@
"True"
]
},
"execution_count": 31,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -104,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 4,
"id": "f7ddde68",
"metadata": {},
"outputs": [
Expand All @@ -114,7 +114,7 @@
"'OK'"
]
},
"execution_count": 32,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -142,7 +142,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 5,
"id": "50bb90b1",
"metadata": {},
"outputs": [
Expand All @@ -152,7 +152,7 @@
"'OK'"
]
},
"execution_count": 8,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -189,7 +189,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "fe95d716",
"metadata": {},
"outputs": [],
Expand All @@ -213,7 +213,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": 7,
"id": "f24ce05d",
"metadata": {},
"outputs": [
Expand All @@ -231,7 +231,7 @@
"con.modelexecute('pytorch_model', 'processed', 'model_out')\n",
"con.scriptexecute('processing_script', 'post_process', inputs='model_out', outputs='final')\n",
"final = con.tensorget('final')\n",
"print(final[0], class_idx[str(ind[0])])"
"print(final[0], class_idx[str(final[0])])"
]
},
{
Expand All @@ -240,12 +240,12 @@
"metadata": {},
"source": [
"## Running with DAG\n",
"Although this looks good, each of these calls has a network overhead of going back and forth and sometimes it's better to run everything as a single execution and that's what you can do with RedisAI DAG. DAGs are much more powerful than that but let's discuss that in another tutorial. Here we first setup a dag object and track all the operations we did above in the dag. Note that none of these tracking steps sends a request to RedisAI server. Once the dag object is ready with all the paths, you can trigger `dag.run()` to initiate the DAG execution in RedisAI backend"
"Although this looks good, each of these calls has a network overhead of going back and forth and sometimes it's better to run everything as a single execution and that's what you can do with RedisAI DAG. DAGs are much more powerful than that but let's discuss that in another tutorial. Here we first setup a dag object and track all the operations we did above in the dag. Note that none of these tracking steps sends a request to RedisAI server. Once the dag object is ready with all the paths, you can trigger `dag.execute()` to initiate the DAG execution in RedisAI backend"
]
},
{
"cell_type": "code",
"execution_count": 51,
"execution_count": 8,
"id": "40e02215",
"metadata": {},
"outputs": [
Expand All @@ -255,14 +255,6 @@
"text": [
"281 tabby, tabby catamount\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/var/folders/66/g3bgwk8s0mq9fmm1d32nmb8c0000gq/T/ipykernel_16269/3084769917.py:8: DeprecationWarning: Call to deprecated method run. (Use execute instead) -- Deprecated since version 1.2.0.\n",
" final = dag.run()[-1]\n"
]
}
],
"source": [
Expand All @@ -273,17 +265,9 @@
"dag.scriptexecute('processing_script', 'post_process', inputs='model_out', outputs='final')\n",
"dag.tensorget('final')\n",
"\n",
"final = dag.run()[-1]\n",
"print(final[0], class_idx[str(ind[0])])"
"final = dag.execute()[-1]\n",
"print(final[0], class_idx[str(final[0])])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3fd407e5",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 999fef6

Please sign in to comment.