Skip to content

Commit 01d8df5

Browse files
authored
update practice (#4679)
* update practice * update save_model
1 parent 7658c4c commit 01d8df5

File tree

6 files changed

+457
-827
lines changed

6 files changed

+457
-827
lines changed

docs/practices/cv/image_search.ipynb

Lines changed: 1 addition & 281 deletions
Original file line numberDiff line numberDiff line change
@@ -83,287 +83,7 @@
8383
"metadata": {
8484
"collapsed": false
8585
},
86-
"outputs": [
87-
{
88-
"name": "stdout",
89-
"output_type": "stream",
90-
"text": [
91-
"item 191/41626 [..............................] - ETA: 28s - 679us/ite"
92-
]
93-
},
94-
{
95-
"name": "stderr",
96-
"output_type": "stream",
97-
"text": [
98-
"Cache file /home/aistudio/.cache/paddle/dataset/cifar/cifar-10-python.tar.gz not found, downloading https://dataset.bj.bcebos.com/cifar/cifar-10-python.tar.gz \n",
99-
"Begin to download\n"
100-
]
101-
},
102-
{
103-
"name": "stdout",
104-
"output_type": "stream",
105-
"text": [
106-
"item 309/41626 [..............................] - ETA: 30s - 731us/item\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bitem 418/41626 [..............................] - ETA: 30s - 736us/it\n",
107-
"item 2796/41626 [=>............................] - ETA: 27s - 702us/it"
108-
]
109-
},
110-
{
111-
"name": "stderr",
112-
"output_type": "stream",
113-
"text": [
114-
"IOPub message rate exceeded.\n",
115-
"The notebook server will temporarily stop sending output\n",
116-
"to the client in order to avoid crashing it.\n",
117-
"To change this limit, set the config variable\n",
118-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
119-
"\n",
120-
"Current values:\n",
121-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
122-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
123-
"\n"
124-
]
125-
},
126-
{
127-
"name": "stdout",
128-
"output_type": "stream",
129-
"text": [
130-
"item 3977/41626 [=>............................] - ETA: 27s - 721us/it\n",
131-
"item 6665/41626 [===>..........................] - ETA: 25s - 731us/item"
132-
]
133-
},
134-
{
135-
"name": "stderr",
136-
"output_type": "stream",
137-
"text": [
138-
"IOPub message rate exceeded.\n",
139-
"The notebook server will temporarily stop sending output\n",
140-
"to the client in order to avoid crashing it.\n",
141-
"To change this limit, set the config variable\n",
142-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
143-
"\n",
144-
"Current values:\n",
145-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
146-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
147-
"\n"
148-
]
149-
},
150-
{
151-
"name": "stdout",
152-
"output_type": "stream",
153-
"text": [
154-
"item 7883/41626 [====>.........................] - ETA: 24s - 737us/i\n",
155-
"item 10573/41626 [======>.......................] - ETA: 22s - 737us/ite"
156-
]
157-
},
158-
{
159-
"name": "stderr",
160-
"output_type": "stream",
161-
"text": [
162-
"IOPub message rate exceeded.\n",
163-
"The notebook server will temporarily stop sending output\n",
164-
"to the client in order to avoid crashing it.\n",
165-
"To change this limit, set the config variable\n",
166-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
167-
"\n",
168-
"Current values:\n",
169-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
170-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
171-
"\n"
172-
]
173-
},
174-
{
175-
"name": "stdout",
176-
"output_type": "stream",
177-
"text": [
178-
"item 11649/41626 [=======>......................] - ETA: 22s - 739us/i\n",
179-
"item 14429/41626 [=========>....................] - ETA: 20s - 749us/it"
180-
]
181-
},
182-
{
183-
"name": "stderr",
184-
"output_type": "stream",
185-
"text": [
186-
"IOPub message rate exceeded.\n",
187-
"The notebook server will temporarily stop sending output\n",
188-
"to the client in order to avoid crashing it.\n",
189-
"To change this limit, set the config variable\n",
190-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
191-
"\n",
192-
"Current values:\n",
193-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
194-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
195-
"\n"
196-
]
197-
},
198-
{
199-
"name": "stdout",
200-
"output_type": "stream",
201-
"text": [
202-
"item 15507/41626 [==========>...................] - ETA: 19s - 747us/it\n",
203-
"item 18274/41626 [============>.................] - ETA: 17s - 746us/it"
204-
]
205-
},
206-
{
207-
"name": "stderr",
208-
"output_type": "stream",
209-
"text": [
210-
"IOPub message rate exceeded.\n",
211-
"The notebook server will temporarily stop sending output\n",
212-
"to the client in order to avoid crashing it.\n",
213-
"To change this limit, set the config variable\n",
214-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
215-
"\n",
216-
"Current values:\n",
217-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
218-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
219-
"\n"
220-
]
221-
},
222-
{
223-
"name": "stdout",
224-
"output_type": "stream",
225-
"text": [
226-
"item 19387/41626 [============>.................] - ETA: 16s - 749us/i\n",
227-
"item 22152/41626 [==============>...............] - ETA: 14s - 752us/ite"
228-
]
229-
},
230-
{
231-
"name": "stderr",
232-
"output_type": "stream",
233-
"text": [
234-
"IOPub message rate exceeded.\n",
235-
"The notebook server will temporarily stop sending output\n",
236-
"to the client in order to avoid crashing it.\n",
237-
"To change this limit, set the config variable\n",
238-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
239-
"\n",
240-
"Current values:\n",
241-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
242-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
243-
"\n"
244-
]
245-
},
246-
{
247-
"name": "stdout",
248-
"output_type": "stream",
249-
"text": [
250-
"item 23505/41626 [===============>..............] - ETA: 13s - 752us/it\n",
251-
"item 26056/41626 [=================>............] - ETA: 11s - 751us/ite"
252-
]
253-
},
254-
{
255-
"name": "stderr",
256-
"output_type": "stream",
257-
"text": [
258-
"IOPub message rate exceeded.\n",
259-
"The notebook server will temporarily stop sending output\n",
260-
"to the client in order to avoid crashing it.\n",
261-
"To change this limit, set the config variable\n",
262-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
263-
"\n",
264-
"Current values:\n",
265-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
266-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
267-
"\n"
268-
]
269-
},
270-
{
271-
"name": "stdout",
272-
"output_type": "stream",
273-
"text": [
274-
"item 27554/41626 [==================>...........] - ETA: 10s - 756us/i\n",
275-
"item 30135/41626 [====================>.........] - ETA: 8s - 757us/it"
276-
]
277-
},
278-
{
279-
"name": "stderr",
280-
"output_type": "stream",
281-
"text": [
282-
"IOPub message rate exceeded.\n",
283-
"The notebook server will temporarily stop sending output\n",
284-
"to the client in order to avoid crashing it.\n",
285-
"To change this limit, set the config variable\n",
286-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
287-
"\n",
288-
"Current values:\n",
289-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
290-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
291-
"\n"
292-
]
293-
},
294-
{
295-
"name": "stdout",
296-
"output_type": "stream",
297-
"text": [
298-
"item 32176/41626 [======================>.......] - ETA: 7s - 753us/\n",
299-
"item 34137/41626 [=======================>......] - ETA: 5s - 752us/it"
300-
]
301-
},
302-
{
303-
"name": "stderr",
304-
"output_type": "stream",
305-
"text": [
306-
"IOPub message rate exceeded.\n",
307-
"The notebook server will temporarily stop sending output\n",
308-
"to the client in order to avoid crashing it.\n",
309-
"To change this limit, set the config variable\n",
310-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
311-
"\n",
312-
"Current values:\n",
313-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
314-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
315-
"\n"
316-
]
317-
},
318-
{
319-
"name": "stdout",
320-
"output_type": "stream",
321-
"text": [
322-
"item 35459/41626 [========================>.....] - ETA: 4s - 754us/\n",
323-
"item 38238/41626 [==========================>...] - ETA: 2s - 750us/it"
324-
]
325-
},
326-
{
327-
"name": "stderr",
328-
"output_type": "stream",
329-
"text": [
330-
"IOPub message rate exceeded.\n",
331-
"The notebook server will temporarily stop sending output\n",
332-
"to the client in order to avoid crashing it.\n",
333-
"To change this limit, set the config variable\n",
334-
"`--NotebookApp.iopub_msg_rate_limit`.\n",
335-
"\n",
336-
"Current values:\n",
337-
"NotebookApp.iopub_msg_rate_limit=1000.0 (msgs/sec)\n",
338-
"NotebookApp.rate_limit_window=3.0 (secs)\n",
339-
"\n"
340-
]
341-
},
342-
{
343-
"name": "stdout",
344-
"output_type": "stream",
345-
"text": [
346-
"item 39537/41626 [===========================>..] - ETA: 1s - 751us/\n",
347-
"item 41626/41626 [============================>.] - ETA: 0s - 749us/item"
348-
]
349-
},
350-
{
351-
"name": "stderr",
352-
"output_type": "stream",
353-
"text": [
354-
"\n",
355-
"Download finished\n"
356-
]
357-
},
358-
{
359-
"name": "stdout",
360-
"output_type": "stream",
361-
"text": [
362-
"(50000, 3, 32, 32)\n",
363-
"(50000,)\n"
364-
]
365-
}
366-
],
86+
"outputs": [],
36787
"source": [
36888
"import paddle.vision.transforms as T\n",
36989
"transform = T.Compose([T.Transpose((2, 0, 1))])\n",

docs/practices/jit/image_search_with_jit.ipynb

Lines changed: 0 additions & 79 deletions
Large diffs are not rendered by default.

docs/practices/quick_start/save_model.ipynb

100755100644
Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -148,35 +148,33 @@
148148
},
149149
"outputs": [
150150
{
151-
"name": "stderr",
151+
"name": "stdout",
152152
"output_type": "stream",
153153
"text": [
154-
"W0422 17:11:10.184468 3841 gpu_context.cc:244] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.0, Runtime API Version: 10.1\n",
155-
"W0422 17:11:10.189138 3841 gpu_context.cc:272] device: 0, cuDNN Version: 7.6.\n"
154+
"The loss value printed in the log is the current step, and the metric is the average value of previous steps.\n",
155+
"Epoch 1/3\n"
156156
]
157157
},
158158
{
159159
"name": "stdout",
160160
"output_type": "stream",
161161
"text": [
162-
"The loss value printed in the log is the current step, and the metric is the average value of previous steps.\n",
163-
"Epoch 1/3\n"
164-
"step 938/938 [==============================] - loss: 0.0882 - acc: 0.9377 - 30ms/step \n",
162+
"step 938/938 [==============================] - loss: 0.0100 - acc: 0.9474 - 30ms/step \n",
165163
"save checkpoint at /home/aistudio/mnist_checkpoint/0\n",
166164
"Eval begin...\n",
167-
"step 157/157 [==============================] - loss: 0.0015 - acc: 0.9771 - 30ms/step \n",
165+
"step 157/157 [==============================] - loss: 0.0044 - acc: 0.9801 - 28ms/step \n",
168166
"Eval samples: 10000\n",
169167
"Epoch 2/3\n",
170-
"step 938/938 [==============================] - loss: 0.0078 - acc: 0.9801 - 29ms/step \n",
168+
"step 938/938 [==============================] - loss: 0.0345 - acc: 0.9813 - 30ms/step \n",
171169
"save checkpoint at /home/aistudio/mnist_checkpoint/1\n",
172170
"Eval begin...\n",
173-
"step 157/157 [==============================] - loss: 2.8927e-04 - acc: 0.9814 - 28ms/step \n",
171+
"step 157/157 [==============================] - loss: 0.0013 - acc: 0.9844 - 27ms/step \n",
174172
"Eval samples: 10000\n",
175173
"Epoch 3/3\n",
176-
"step 938/938 [==============================] - loss: 0.0321 - acc: 0.9865 - 30ms/step \n",
174+
"step 938/938 [==============================] - loss: 0.0028 - acc: 0.9869 - 29ms/step \n",
177175
"save checkpoint at /home/aistudio/mnist_checkpoint/2\n",
178176
"Eval begin...\n",
179-
"step 157/157 [==============================] - loss: 3.5028e-04 - acc: 0.9829 - 31ms/step \n",
177+
"step 157/157 [==============================] - loss: 0.0013 - acc: 0.9872 - 28ms/step \n",
180178
"Eval samples: 10000\n",
181179
"save checkpoint at /home/aistudio/mnist_checkpoint/final\n"
182180
]
@@ -253,16 +251,16 @@
253251
"text": [
254252
"The loss value printed in the log is the current step, and the metric is the average value of previous steps.\n",
255253
"Epoch 1/2\n",
256-
"step 938/938 [==============================] - loss: 0.0107 - acc: 0.9886 - 30ms/step \n",
254+
"step 938/938 [==============================] - loss: 0.0036 - acc: 0.9895 - 29ms/step \n",
257255
"save checkpoint at /home/aistudio/mnist_checkpoint/0\n",
258256
"Eval begin...\n",
259-
"step 157/157 [==============================] - loss: 3.7397e-05 - acc: 0.9864 - 29ms/step \n",
257+
"step 157/157 [==============================] - loss: 0.0025 - acc: 0.9874 - 28ms/step \n",
260258
"Eval samples: 10000\n",
261259
"Epoch 2/2\n",
262-
"step 938/938 [==============================] - loss: 5.9229e-04 - acc: 0.9918 - 30ms/step \n",
260+
"step 938/938 [==============================] - loss: 8.8357e-04 - acc: 0.9925 - 29ms/step \n",
263261
"save checkpoint at /home/aistudio/mnist_checkpoint/1\n",
264262
"Eval begin...\n",
265-
"step 157/157 [==============================] - loss: 5.6621e-05 - acc: 0.9832 - 30ms/step \n",
263+
"step 157/157 [==============================] - loss: 4.4413e-04 - acc: 0.9884 - 28ms/step \n",
266264
"Eval samples: 10000\n",
267265
"save checkpoint at /home/aistudio/mnist_checkpoint/final\n"
268266
]
@@ -364,14 +362,14 @@
364362
"text": [
365363
"The loss value printed in the log is the current step, and the metric is the average value of previous steps.\n",
366364
"Epoch 1/2\n",
367-
"step 938/938 [==============================] - loss: 8.9464e-04 - acc: 0.9920 - 30ms/step \n",
365+
"step 938/938 [==============================] - loss: 0.0018 - acc: 0.9926 - 29ms/step \n",
368366
"Eval begin...\n",
369-
"step 157/157 [==============================] - loss: 2.2678e-05 - acc: 0.9851 - 28ms/step \n",
367+
"step 157/157 [==============================] - loss: 1.3860e-04 - acc: 0.9863 - 28ms/step \n",
370368
"Eval samples: 10000\n",
371369
"Epoch 2/2\n",
372-
"step 938/938 [==============================] - loss: 2.6110e-04 - acc: 0.9944 - 30ms/step \n",
370+
"step 938/938 [==============================] - loss: 1.5363e-04 - acc: 0.9949 - 30ms/step \n",
373371
"Eval begin...\n",
374-
"step 157/157 [==============================] - loss: 6.7650e-06 - acc: 0.9866 - 32ms/step \n",
372+
"step 157/157 [==============================] - loss: 1.5809e-04 - acc: 0.9880 - 29ms/step \n",
375373
"Eval samples: 10000\n"
376374
]
377375
}

0 commit comments

Comments
 (0)