|
11 | 11 | },
|
12 | 12 | {
|
13 | 13 | "cell_type": "code",
|
14 |
| - "execution_count": 28, |
| 14 | + "execution_count": 1, |
15 | 15 | "id": "1e657632",
|
16 | 16 | "metadata": {},
|
17 | 17 | "outputs": [],
|
|
40 | 40 | },
|
41 | 41 | {
|
42 | 42 | "cell_type": "code",
|
43 |
| - "execution_count": 29, |
| 43 | + "execution_count": 2, |
44 | 44 | "id": "56edea97",
|
45 | 45 | "metadata": {},
|
46 | 46 | "outputs": [],
|
|
69 | 69 | },
|
70 | 70 | {
|
71 | 71 | "cell_type": "code",
|
72 |
| - "execution_count": 31, |
| 72 | + "execution_count": 3, |
73 | 73 | "id": "59b6599a",
|
74 | 74 | "metadata": {},
|
75 | 75 | "outputs": [
|
|
79 | 79 | "True"
|
80 | 80 | ]
|
81 | 81 | },
|
82 |
| - "execution_count": 31, |
| 82 | + "execution_count": 3, |
83 | 83 | "metadata": {},
|
84 | 84 | "output_type": "execute_result"
|
85 | 85 | }
|
|
104 | 104 | },
|
105 | 105 | {
|
106 | 106 | "cell_type": "code",
|
107 |
| - "execution_count": 32, |
| 107 | + "execution_count": 4, |
108 | 108 | "id": "f7ddde68",
|
109 | 109 | "metadata": {},
|
110 | 110 | "outputs": [
|
|
114 | 114 | "'OK'"
|
115 | 115 | ]
|
116 | 116 | },
|
117 |
| - "execution_count": 32, |
| 117 | + "execution_count": 4, |
118 | 118 | "metadata": {},
|
119 | 119 | "output_type": "execute_result"
|
120 | 120 | }
|
|
142 | 142 | },
|
143 | 143 | {
|
144 | 144 | "cell_type": "code",
|
145 |
| - "execution_count": 8, |
| 145 | + "execution_count": 5, |
146 | 146 | "id": "50bb90b1",
|
147 | 147 | "metadata": {},
|
148 | 148 | "outputs": [
|
|
152 | 152 | "'OK'"
|
153 | 153 | ]
|
154 | 154 | },
|
155 |
| - "execution_count": 8, |
| 155 | + "execution_count": 5, |
156 | 156 | "metadata": {},
|
157 | 157 | "output_type": "execute_result"
|
158 | 158 | }
|
|
189 | 189 | },
|
190 | 190 | {
|
191 | 191 | "cell_type": "code",
|
192 |
| - "execution_count": null, |
| 192 | + "execution_count": 6, |
193 | 193 | "id": "fe95d716",
|
194 | 194 | "metadata": {},
|
195 | 195 | "outputs": [],
|
|
213 | 213 | },
|
214 | 214 | {
|
215 | 215 | "cell_type": "code",
|
216 |
| - "execution_count": 49, |
| 216 | + "execution_count": 7, |
217 | 217 | "id": "f24ce05d",
|
218 | 218 | "metadata": {},
|
219 | 219 | "outputs": [
|
|
231 | 231 | "con.modelexecute('pytorch_model', 'processed', 'model_out')\n",
|
232 | 232 | "con.scriptexecute('processing_script', 'post_process', inputs='model_out', outputs='final')\n",
|
233 | 233 | "final = con.tensorget('final')\n",
|
234 |
| - "print(final[0], class_idx[str(ind[0])])" |
| 234 | + "print(final[0], class_idx[str(final[0])])" |
235 | 235 | ]
|
236 | 236 | },
|
237 | 237 | {
|
|
240 | 240 | "metadata": {},
|
241 | 241 | "source": [
|
242 | 242 | "## Running with DAG\n",
|
243 |
| - "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" |
| 243 | + "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" |
244 | 244 | ]
|
245 | 245 | },
|
246 | 246 | {
|
247 | 247 | "cell_type": "code",
|
248 |
| - "execution_count": 51, |
| 248 | + "execution_count": 8, |
249 | 249 | "id": "40e02215",
|
250 | 250 | "metadata": {},
|
251 | 251 | "outputs": [
|
|
255 | 255 | "text": [
|
256 | 256 | "281 tabby, tabby catamount\n"
|
257 | 257 | ]
|
258 |
| - }, |
259 |
| - { |
260 |
| - "name": "stderr", |
261 |
| - "output_type": "stream", |
262 |
| - "text": [ |
263 |
| - "/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", |
264 |
| - " final = dag.run()[-1]\n" |
265 |
| - ] |
266 | 258 | }
|
267 | 259 | ],
|
268 | 260 | "source": [
|
|
273 | 265 | "dag.scriptexecute('processing_script', 'post_process', inputs='model_out', outputs='final')\n",
|
274 | 266 | "dag.tensorget('final')\n",
|
275 | 267 | "\n",
|
276 |
| - "final = dag.run()[-1]\n", |
277 |
| - "print(final[0], class_idx[str(ind[0])])" |
| 268 | + "final = dag.execute()[-1]\n", |
| 269 | + "print(final[0], class_idx[str(final[0])])" |
278 | 270 | ]
|
279 |
| - }, |
280 |
| - { |
281 |
| - "cell_type": "code", |
282 |
| - "execution_count": null, |
283 |
| - "id": "3fd407e5", |
284 |
| - "metadata": {}, |
285 |
| - "outputs": [], |
286 |
| - "source": [] |
287 | 271 | }
|
288 | 272 | ],
|
289 | 273 | "metadata": {
|
|
0 commit comments