| 0 | |
|
| 1 | |
{
|
| 2 | |
"cells": [
|
| 3 | |
{
|
| 4 | |
"cell_type": "code",
|
| 5 | |
"execution_count": null,
|
| 6 | |
"metadata": {},
|
| 7 | |
"outputs": [],
|
| 8 | |
"source": [
|
| 9 | |
"print('Hello Mo!')"
|
| 10 | |
]
|
| 11 | |
}
|
| 12 | |
],
|
| 13 | |
"metadata": {
|
| 14 | |
"kernelspec": {
|
| 15 | |
"display_name": "Python 3",
|
| 16 | |
"language": "python",
|
| 17 | |
"name": "python3"
|
| 18 | |
},
|
| 19 | |
"language_info": {
|
| 20 | |
"codemirror_mode": {
|
| 21 | |
"name": "ipython",
|
| 22 | |
"version": 3
|
| 23 | |
},
|
| 24 | |
"file_extension": ".py",
|
| 25 | |
"mimetype": "text/x-python",
|
| 26 | |
"name": "python",
|
| 27 | |
"nbconvert_exporter": "python",
|
| 28 | |
"pygments_lexer": "ipython3",
|
| 29 | |
"version": "3.5.2"
|
| 30 | |
}
|
| 31 | |
},
|
| 32 | |
"nbformat": 4,
|
| 33 | |
"nbformat_minor": 2
|
| 34 | |
}
|
| 35 | |
⏎
|
|
0 |
{
|
|
1 |
"cells": [
|
|
2 |
{
|
|
3 |
"cell_type": "code",
|
|
4 |
"execution_count": 1,
|
|
5 |
"metadata": {},
|
|
6 |
"outputs": [
|
|
7 |
{
|
|
8 |
"name": "stdout",
|
|
9 |
"output_type": "stream",
|
|
10 |
"text": [
|
|
11 |
"Hello Mo!\n"
|
|
12 |
]
|
|
13 |
}
|
|
14 |
],
|
|
15 |
"source": [
|
|
16 |
"print('Hello Mo!')"
|
|
17 |
]
|
|
18 |
},
|
|
19 |
{
|
|
20 |
"cell_type": "code",
|
|
21 |
"execution_count": 5,
|
|
22 |
"metadata": {},
|
|
23 |
"outputs": [
|
|
24 |
{
|
|
25 |
"name": "stdout",
|
|
26 |
"output_type": "stream",
|
|
27 |
"text": [
|
|
28 |
"3\n"
|
|
29 |
]
|
|
30 |
}
|
|
31 |
],
|
|
32 |
"source": [
|
|
33 |
"b=2\n",
|
|
34 |
"a = b +1\n",
|
|
35 |
"print(a)"
|
|
36 |
]
|
|
37 |
},
|
|
38 |
{
|
|
39 |
"cell_type": "code",
|
|
40 |
"execution_count": 6,
|
|
41 |
"metadata": {},
|
|
42 |
"outputs": [],
|
|
43 |
"source": [
|
|
44 |
"import torch"
|
|
45 |
]
|
|
46 |
},
|
|
47 |
{
|
|
48 |
"cell_type": "code",
|
|
49 |
"execution_count": 9,
|
|
50 |
"metadata": {},
|
|
51 |
"outputs": [
|
|
52 |
{
|
|
53 |
"name": "stdout",
|
|
54 |
"output_type": "stream",
|
|
55 |
"text": [
|
|
56 |
"tensor([0., 0., 0.])\n"
|
|
57 |
]
|
|
58 |
}
|
|
59 |
],
|
|
60 |
"source": [
|
|
61 |
"a = torch.zeros(3)\n",
|
|
62 |
"print(a)"
|
|
63 |
]
|
|
64 |
},
|
|
65 |
{
|
|
66 |
"cell_type": "code",
|
|
67 |
"execution_count": 1,
|
|
68 |
"metadata": {},
|
|
69 |
"outputs": [
|
|
70 |
{
|
|
71 |
"ename": "ImportError",
|
|
72 |
"evalue": "No module named 'mindspore'",
|
|
73 |
"output_type": "error",
|
|
74 |
"traceback": [
|
|
75 |
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|
76 |
"\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
|
|
77 |
"\u001b[0;32m<ipython-input-1-39d0ce7864e1>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mmindspore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnn\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mnn\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
|
|
78 |
"\u001b[0;31mImportError\u001b[0m: No module named 'mindspore'"
|
|
79 |
]
|
|
80 |
}
|
|
81 |
],
|
|
82 |
"source": [
|
|
83 |
"import mindspore.nn as nn"
|
|
84 |
]
|
|
85 |
},
|
|
86 |
{
|
|
87 |
"cell_type": "code",
|
|
88 |
"execution_count": 1,
|
|
89 |
"metadata": {},
|
|
90 |
"outputs": [
|
|
91 |
{
|
|
92 |
"name": "stdout",
|
|
93 |
"output_type": "stream",
|
|
94 |
"text": [
|
|
95 |
"Looking in indexes: https://mirrors.aliyun.com/pypi/simple\n",
|
|
96 |
"Collecting mindspore\n",
|
|
97 |
"\u001b[31m ERROR: Could not find a version that satisfies the requirement mindspore (from versions: none)\u001b[0m\n",
|
|
98 |
"\u001b[31mERROR: No matching distribution found for mindspore\u001b[0m\n",
|
|
99 |
"\u001b[33mWARNING: You are using pip version 19.1.1, however version 20.2.3 is available.\n",
|
|
100 |
"You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n",
|
|
101 |
"Note: you may need to restart the kernel to use updated packages.\n"
|
|
102 |
]
|
|
103 |
}
|
|
104 |
],
|
|
105 |
"source": [
|
|
106 |
"pip install mindspore"
|
|
107 |
]
|
|
108 |
},
|
|
109 |
{
|
|
110 |
"cell_type": "code",
|
|
111 |
"execution_count": 2,
|
|
112 |
"metadata": {},
|
|
113 |
"outputs": [
|
|
114 |
{
|
|
115 |
"name": "stdout",
|
|
116 |
"output_type": "stream",
|
|
117 |
"text": [
|
|
118 |
"Looking in indexes: https://mirrors.aliyun.com/pypi/simple\n",
|
|
119 |
"Collecting mindspore\n",
|
|
120 |
"\u001b[31m ERROR: Could not find a version that satisfies the requirement mindspore (from versions: none)\u001b[0m\n",
|
|
121 |
"\u001b[31mERROR: No matching distribution found for mindspore\u001b[0m\n",
|
|
122 |
"\u001b[33mWARNING: You are using pip version 19.1.1, however version 20.2.3 is available.\n",
|
|
123 |
"You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n",
|
|
124 |
"Note: you may need to restart the kernel to use updated packages.\n"
|
|
125 |
]
|
|
126 |
}
|
|
127 |
],
|
|
128 |
"source": [
|
|
129 |
"pip install mindspore"
|
|
130 |
]
|
|
131 |
},
|
|
132 |
{
|
|
133 |
"cell_type": "code",
|
|
134 |
"execution_count": 2,
|
|
135 |
"metadata": {},
|
|
136 |
"outputs": [
|
|
137 |
{
|
|
138 |
"name": "stdout",
|
|
139 |
"output_type": "stream",
|
|
140 |
"text": [
|
|
141 |
"Package Version \n",
|
|
142 |
"-------------------- ------------\n",
|
|
143 |
"absl-py 0.7.1 \n",
|
|
144 |
"alembic 1.4.2 \n",
|
|
145 |
"appdirs 1.4.4 \n",
|
|
146 |
"astor 0.7.1 \n",
|
|
147 |
"async-generator 1.10 \n",
|
|
148 |
"attrs 19.3.0 \n",
|
|
149 |
"Augmentor 0.2.8 \n",
|
|
150 |
"backcall 0.2.0 \n",
|
|
151 |
"baytune 0.3.10 \n",
|
|
152 |
"bleach 3.1.5 \n",
|
|
153 |
"boto3 1.14.34 \n",
|
|
154 |
"botocore 1.17.34 \n",
|
|
155 |
"certifi 2020.6.20 \n",
|
|
156 |
"certipy 0.1.3 \n",
|
|
157 |
"cffi 1.14.1 \n",
|
|
158 |
"chardet 3.0.4 \n",
|
|
159 |
"click 7.1.2 \n",
|
|
160 |
"configparser 4.0.2 \n",
|
|
161 |
"cryptography 3.0 \n",
|
|
162 |
"cycler 0.10.0 \n",
|
|
163 |
"Cython 0.29.20 \n",
|
|
164 |
"decorator 4.4.2 \n",
|
|
165 |
"defusedxml 0.6.0 \n",
|
|
166 |
"distlib 0.3.1 \n",
|
|
167 |
"docutils 0.15.2 \n",
|
|
168 |
"entrypoints 0.3 \n",
|
|
169 |
"et-xmlfile 1.0.1 \n",
|
|
170 |
"filelock 3.0.12 \n",
|
|
171 |
"func-timeout 4.3.5 \n",
|
|
172 |
"future 0.18.2 \n",
|
|
173 |
"gast 0.2.2 \n",
|
|
174 |
"graphviz 0.14 \n",
|
|
175 |
"grpcio 1.20.1 \n",
|
|
176 |
"h5py 2.9.0 \n",
|
|
177 |
"idna 2.10 \n",
|
|
178 |
"imageio 2.8.0 \n",
|
|
179 |
"imgaug 0.4.0 \n",
|
|
180 |
"importlib-metadata 0.23 \n",
|
|
181 |
"importlib-resources 3.0.0 \n",
|
|
182 |
"ipdb 0.13.2 \n",
|
|
183 |
"ipykernel 5.3.4 \n",
|
|
184 |
"ipython 7.9.0 \n",
|
|
185 |
"ipython-genutils 0.2.0 \n",
|
|
186 |
"ipywidgets 7.4.0 \n",
|
|
187 |
"jdcal 1.4.1 \n",
|
|
188 |
"jedi 0.17.2 \n",
|
|
189 |
"jieba 0.42.1 \n",
|
|
190 |
"Jinja2 2.11.2 \n",
|
|
191 |
"jmespath 0.10.0 \n",
|
|
192 |
"joblib 0.14.1 \n",
|
|
193 |
"jsonschema 3.2.0 \n",
|
|
194 |
"jupyter-client 6.1.6 \n",
|
|
195 |
"jupyter-core 4.6.3 \n",
|
|
196 |
"jupyterhub 1.0.0 \n",
|
|
197 |
"jupyterlab 1.0.0a1 \n",
|
|
198 |
"jupyterlab-server 0.2.0 \n",
|
|
199 |
"Keras 2.3.1 \n",
|
|
200 |
"Keras-Applications 1.0.7 \n",
|
|
201 |
"Keras-Preprocessing 1.0.9 \n",
|
|
202 |
"kiwisolver 1.1.0 \n",
|
|
203 |
"Mako 1.1.3 \n",
|
|
204 |
"Markdown 3.1 \n",
|
|
205 |
"MarkupSafe 1.1.1 \n",
|
|
206 |
"matplotlib 3.0.3 \n",
|
|
207 |
"minepy 1.2.4 \n",
|
|
208 |
"minio 5.0.10 \n",
|
|
209 |
"mistune 0.8.4 \n",
|
|
210 |
"mock 2.0.0 \n",
|
|
211 |
"more-itertools 7.2.0 \n",
|
|
212 |
"nbconvert 5.6.1 \n",
|
|
213 |
"nbformat 5.0.7 \n",
|
|
214 |
"networkx 2.4 \n",
|
|
215 |
"nltk 3.5 \n",
|
|
216 |
"notebook 6.0.3 \n",
|
|
217 |
"numpy 1.16.0 \n",
|
|
218 |
"oauthlib 3.1.0 \n",
|
|
219 |
"opencv-python 4.2.0.34 \n",
|
|
220 |
"openpyxl 2.6.4 \n",
|
|
221 |
"packaging 20.4 \n",
|
|
222 |
"pamela 1.0.0 \n",
|
|
223 |
"pandas 0.24.2 \n",
|
|
224 |
"pandocfilters 1.4.2 \n",
|
|
225 |
"parso 0.7.1 \n",
|
|
226 |
"pbr 5.2.0 \n",
|
|
227 |
"pexpect 4.8.0 \n",
|
|
228 |
"pickleshare 0.7.5 \n",
|
|
229 |
"Pillow 7.2.0 \n",
|
|
230 |
"pip 19.1.1 \n",
|
|
231 |
"plotly 4.8.1 \n",
|
|
232 |
"prometheus-client 0.8.0 \n",
|
|
233 |
"prompt-toolkit 2.0.10 \n",
|
|
234 |
"protobuf 3.12.4 \n",
|
|
235 |
"ptyprocess 0.6.0 \n",
|
|
236 |
"pycparser 2.20 \n",
|
|
237 |
"pydot 1.4.1 \n",
|
|
238 |
"pyenchant 3.1.1 \n",
|
|
239 |
"Pygments 2.6.1 \n",
|
|
240 |
"pyOpenSSL 19.1.0 \n",
|
|
241 |
"pyparsing 2.4.7 \n",
|
|
242 |
"pyrsistent 0.16.0 \n",
|
|
243 |
"python-dateutil 2.8.0 \n",
|
|
244 |
"python-editor 1.0.4 \n",
|
|
245 |
"pytz 2020.1 \n",
|
|
246 |
"PyWavelets 1.1.1 \n",
|
|
247 |
"PyYAML 5.3.1 \n",
|
|
248 |
"pyzmq 19.0.2 \n",
|
|
249 |
"regex 2020.7.14 \n",
|
|
250 |
"requests 2.24.0 \n",
|
|
251 |
"retrying 1.3.3 \n",
|
|
252 |
"s3transfer 0.3.3 \n",
|
|
253 |
"sacremoses 0.0.43 \n",
|
|
254 |
"scikit-image 0.15.0 \n",
|
|
255 |
"scikit-learn 0.22.2.post1\n",
|
|
256 |
"scipy 1.4.1 \n",
|
|
257 |
"seaborn 0.9.1 \n",
|
|
258 |
"Send2Trash 1.5.0 \n",
|
|
259 |
"sentencepiece 0.1.91 \n",
|
|
260 |
"setuptools 49.2.0 \n",
|
|
261 |
"Shapely 1.7.0 \n",
|
|
262 |
"six 1.12.0 \n",
|
|
263 |
"SQLAlchemy 1.3.18 \n",
|
|
264 |
"stevedore 1.32.0 \n",
|
|
265 |
"tensorboard 1.13.1 \n",
|
|
266 |
"tensorboardX 2.0 \n",
|
|
267 |
"tensorflow 1.13.1 \n",
|
|
268 |
"tensorflow-estimator 1.13.0 \n",
|
|
269 |
"termcolor 1.1.0 \n",
|
|
270 |
"terminado 0.8.3 \n",
|
|
271 |
"testpath 0.4.4 \n",
|
|
272 |
"tokenizers 0.5.2 \n",
|
|
273 |
"torch 1.4.0+cpu \n",
|
|
274 |
"torchtext 0.6.0 \n",
|
|
275 |
"torchvision 0.5.0+cpu \n",
|
|
276 |
"tornado 6.0.4 \n",
|
|
277 |
"tqdm 4.46.1 \n",
|
|
278 |
"traitlets 4.3.3 \n",
|
|
279 |
"transformers 2.5.1 \n",
|
|
280 |
"urllib3 1.25.10 \n",
|
|
281 |
"virtualenv 20.0.29 \n",
|
|
282 |
"virtualenv-clone 0.5.4 \n",
|
|
283 |
"virtualenvwrapper 4.8.4 \n",
|
|
284 |
"wcwidth 0.2.5 \n",
|
|
285 |
"webencodings 0.5.1 \n",
|
|
286 |
"Werkzeug 0.15.2 \n",
|
|
287 |
"wheel 0.34.2 \n",
|
|
288 |
"widgetsnbextension 3.4.2 \n",
|
|
289 |
"word2vec 0.10.6 \n",
|
|
290 |
"xlrd 1.2.0 \n",
|
|
291 |
"yellowbrick 1.1 \n",
|
|
292 |
"zipp 0.6.0 \n",
|
|
293 |
"\u001b[33mWARNING: You are using pip version 19.1.1, however version 20.2.3 is available.\n",
|
|
294 |
"You should consider upgrading via the 'pip install --upgrade pip' command.\u001b[0m\n"
|
|
295 |
]
|
|
296 |
}
|
|
297 |
],
|
|
298 |
"source": [
|
|
299 |
"!pip list --format=columns"
|
|
300 |
]
|
|
301 |
},
|
|
302 |
{
|
|
303 |
"cell_type": "code",
|
|
304 |
"execution_count": 3,
|
|
305 |
"metadata": {},
|
|
306 |
"outputs": [
|
|
307 |
{
|
|
308 |
"name": "stdout",
|
|
309 |
"output_type": "stream",
|
|
310 |
"text": [
|
|
311 |
"/bin/sh: 1: 7zx: not found\n"
|
|
312 |
]
|
|
313 |
}
|
|
314 |
],
|
|
315 |
"source": [
|
|
316 |
"!7zx ./datasets/sumansid-facemask-dataset-momodel/facemask-dataset.zip -d"
|
|
317 |
]
|
|
318 |
},
|
|
319 |
{
|
|
320 |
"cell_type": "code",
|
|
321 |
"execution_count": 4,
|
|
322 |
"metadata": {},
|
|
323 |
"outputs": [
|
|
324 |
{
|
|
325 |
"name": "stdout",
|
|
326 |
"output_type": "stream",
|
|
327 |
"text": [
|
|
328 |
"/bin/sh: 1: 7zx: not found\n"
|
|
329 |
]
|
|
330 |
}
|
|
331 |
],
|
|
332 |
"source": [
|
|
333 |
"!7zx ./datasets/sumansid-facemask-dataset-momodel/facemask-dataset.zip"
|
|
334 |
]
|
|
335 |
},
|
|
336 |
{
|
|
337 |
"cell_type": "code",
|
|
338 |
"execution_count": null,
|
|
339 |
"metadata": {},
|
|
340 |
"outputs": [],
|
|
341 |
"source": []
|
|
342 |
}
|
|
343 |
],
|
|
344 |
"metadata": {
|
|
345 |
"kernelspec": {
|
|
346 |
"display_name": "Python 3",
|
|
347 |
"language": "python",
|
|
348 |
"name": "python3"
|
|
349 |
},
|
|
350 |
"language_info": {
|
|
351 |
"codemirror_mode": {
|
|
352 |
"name": "ipython",
|
|
353 |
"version": 3
|
|
354 |
},
|
|
355 |
"file_extension": ".py",
|
|
356 |
"mimetype": "text/x-python",
|
|
357 |
"name": "python",
|
|
358 |
"nbconvert_exporter": "python",
|
|
359 |
"pygments_lexer": "ipython3",
|
|
360 |
"version": "3.5.2"
|
|
361 |
}
|
|
362 |
},
|
|
363 |
"nbformat": 4,
|
|
364 |
"nbformat_minor": 2
|
|
365 |
}
|