Skip to content

Commit 4b2771a

Browse files
Fix copyright and guidelines test errors for remaining tutorials (#1182)
Fixes #1181 . ### Description - Update the guideline test to avoid counting line returns in non-text outputs (for example, html data) - Add copyright for all remaining scripts and clean replicates of old copyright info in the following notebooks - 2d_classification\mednist_tutorial.ipynb - 2d_registration\registration_mednist.ipynb - 3d_classification\densenet_training_array.ipynb - acceleration\multi_gpu_test.ipynb - acceleration\threadbuffer_performance.ipynb - acceleration\transform_speed.ipynb - modules\TorchIO_MONAI_PyTorch_Lightning.ipynb - modules\UNet_input_size_constrains.ipynb - multimodal\openi_multilabel_classification_transchex\transchex_openi_multilabel_classification.ipynb - experiment_management\spleen_segmentation_aim.ipynb - experiment_management\spleen_segmentation_mlflow.ipynb - Fix markdown cells for notebooks to match guidelines - experiment_management\bundle_integrate_mlflow.ipynb - modules\resample_benchmark.ipynb - Update the outputs in the following notebooks: - 2d_classification\mednist_tutorial.ipynb - 2d_registration\registration_mednist.ipynb - 3d_classification\densenet_training_array.ipynb ### Checks <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Avoid including large-size files in the PR. - [x] Clean up long text outputs from code cells in the notebook. - [x] For security purposes, please check the contents and remove any sensitive info such as user names and private key. - [x] Ensure (1) hyperlinks and markdown anchors are working (2) use relative paths for tutorial repo files (3) put figure and graphs in the `./figure` folder - [ ] Notebook runs automatically `./runner.sh -t <path to .ipynb file>` Signed-off-by: Mingxin Zheng <[email protected]> Signed-off-by: Mingxin Zheng <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent bb33315 commit 4b2771a

File tree

73 files changed

+741
-928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+741
-928
lines changed

2d_classification/mednist_tutorial.ipynb

+64-66
Large diffs are not rendered by default.

2d_registration/registration_mednist.ipynb

+88-67
Large diffs are not rendered by default.

2d_segmentation/torch/unet_evaluation_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

2d_segmentation/torch/unet_evaluation_dict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

2d_segmentation/torch/unet_training_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

2d_segmentation/torch/unet_training_dict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

3d_classification/densenet_training_array.ipynb

+13-12
Large diffs are not rendered by default.

3d_classification/ignite/densenet_evaluation_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

3d_classification/ignite/densenet_evaluation_dict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

3d_classification/ignite/densenet_training_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

3d_classification/ignite/densenet_training_dict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

3d_classification/torch/densenet_evaluation_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

3d_classification/torch/densenet_evaluation_dict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

3d_classification/torch/densenet_training_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

3d_classification/torch/densenet_training_dict.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

acceleration/distributed_training/unet_evaluation_ddp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

acceleration/distributed_training/unet_evaluation_horovod.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

acceleration/distributed_training/unet_evaluation_workflows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

acceleration/distributed_training/unet_training_ddp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

acceleration/distributed_training/unet_training_horovod.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

acceleration/distributed_training/unet_training_smartcache.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

acceleration/distributed_training/unet_training_workflows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 MONAI Consortium
1+
# Copyright (c) MONAI Consortium
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at

acceleration/multi_gpu_test.ipynb

+76-49
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7+
"Copyright (c) MONAI Consortium \n",
8+
"Licensed under the Apache License, Version 2.0 (the \"License\"); \n",
9+
"you may not use this file except in compliance with the License. \n",
10+
"You may obtain a copy of the License at \n",
11+
"&nbsp;&nbsp;&nbsp;&nbsp;http://www.apache.org/licenses/LICENSE-2.0 \n",
12+
"Unless required by applicable law or agreed to in writing, software \n",
13+
"distributed under the License is distributed on an \"AS IS\" BASIS, \n",
14+
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n",
15+
"See the License for the specific language governing permissions and \n",
16+
"limitations under the License.\n",
17+
"\n",
718
"# Multi GPU Test\n",
819
"\n",
920
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Project-MONAI/tutorials/blob/main/acceleration/multi_gpu_test.ipynb)"
@@ -18,19 +29,11 @@
1829
},
1930
{
2031
"cell_type": "code",
21-
"execution_count": 1,
32+
"execution_count": null,
2233
"metadata": {
2334
"tags": []
2435
},
25-
"outputs": [
26-
{
27-
"name": "stdout",
28-
"output_type": "stream",
29-
"text": [
30-
"Note: you may need to restart the kernel to use updated packages.\n"
31-
]
32-
}
33-
],
36+
"outputs": [],
3437
"source": [
3538
"!python -c \"import monai\" || pip install -q \"monai-weekly[ignite]\""
3639
]
@@ -44,7 +47,7 @@
4447
},
4548
{
4649
"cell_type": "code",
47-
"execution_count": 1,
50+
"execution_count": null,
4851
"metadata": {
4952
"tags": []
5053
},
@@ -53,24 +56,29 @@
5356
"name": "stdout",
5457
"output_type": "stream",
5558
"text": [
56-
"MONAI version: 0.4.0\n",
57-
"Numpy version: 1.19.1\n",
58-
"Pytorch version: 1.7.0a0+7036e91\n",
59-
"MONAI flags: HAS_EXT = False, USE_COMPILED = False\n",
60-
"MONAI rev id: 0563a4467fa602feca92d91c7f47261868d171a1\n",
59+
"MONAI version: 1.1.0+2.g97918e46\n",
60+
"Numpy version: 1.22.2\n",
61+
"Pytorch version: 1.13.0a0+d0d6b1f\n",
62+
"MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False\n",
63+
"MONAI rev id: 97918e46e0d2700c050e678d72e3edb35afbd737\n",
64+
"MONAI __file__: /workspace/monai/monai-in-dev/monai/__init__.py\n",
6165
"\n",
6266
"Optional dependencies:\n",
63-
"Pytorch Ignite version: 0.4.2\n",
64-
"Nibabel version: 3.2.1\n",
65-
"scikit-image version: 0.15.0\n",
66-
"Pillow version: 8.0.1\n",
67-
"Tensorboard version: 2.2.0\n",
68-
"gdown version: 3.12.2\n",
69-
"TorchVision version: 0.8.0a0\n",
70-
"ITK version: 5.1.2\n",
71-
"tqdm version: 4.54.1\n",
72-
"lmdb version: 1.0.0\n",
73-
"psutil version: 5.7.2\n",
67+
"Pytorch Ignite version: 0.4.10\n",
68+
"Nibabel version: 4.0.2\n",
69+
"scikit-image version: 0.19.3\n",
70+
"Pillow version: 9.0.1\n",
71+
"Tensorboard version: 2.10.1\n",
72+
"gdown version: 4.6.0\n",
73+
"TorchVision version: 0.14.0a0\n",
74+
"tqdm version: 4.64.1\n",
75+
"lmdb version: 1.3.0\n",
76+
"psutil version: 5.9.2\n",
77+
"pandas version: 1.4.4\n",
78+
"einops version: 0.6.0\n",
79+
"transformers version: 4.21.3\n",
80+
"mlflow version: 2.0.1\n",
81+
"pynrrd version: 1.0.0\n",
7482
"\n",
7583
"For details about installing the optional dependencies, please visit:\n",
7684
" https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies\n",
@@ -79,17 +87,6 @@
7987
}
8088
],
8189
"source": [
82-
"# Copyright 2020 MONAI Consortium\n",
83-
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
84-
"# you may not use this file except in compliance with the License.\n",
85-
"# You may obtain a copy of the License at\n",
86-
"# http://www.apache.org/licenses/LICENSE-2.0\n",
87-
"# Unless required by applicable law or agreed to in writing, software\n",
88-
"# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
89-
"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
90-
"# See the License for the specific language governing permissions and\n",
91-
"# limitations under the License.\n",
92-
"\n",
9390
"import torch\n",
9491
"from monai.config import print_config\n",
9592
"from monai.engines import create_multigpu_supervised_trainer\n",
@@ -107,7 +104,7 @@
107104
},
108105
{
109106
"cell_type": "code",
110-
"execution_count": 2,
107+
"execution_count": null,
111108
"metadata": {},
112109
"outputs": [],
113110
"source": [
@@ -142,13 +139,23 @@
142139
},
143140
{
144141
"cell_type": "code",
145-
"execution_count": 3,
142+
"execution_count": null,
146143
"metadata": {
147144
"pycharm": {
148145
"name": "#%%\n"
149146
}
150147
},
151148
"outputs": [
149+
{
150+
"name": "stdout",
151+
"output_type": "stream",
152+
"text": [
153+
"2023-01-20 14:16:00,009 - Engine run starting with max_epochs=2.\n",
154+
"2023-01-20 14:16:00,189 - Epoch[1] Complete. Time taken: 00:00:00.180\n",
155+
"2023-01-20 14:16:00,201 - Epoch[2] Complete. Time taken: 00:00:00.011\n",
156+
"2023-01-20 14:16:00,201 - Engine run complete. Time taken: 00:00:00.192\n"
157+
]
158+
},
152159
{
153160
"data": {
154161
"text/plain": [
@@ -157,15 +164,15 @@
157164
"\tepoch: 2\n",
158165
"\tepoch_length: 2\n",
159166
"\tmax_epochs: 2\n",
160-
"\toutput: 34253.46875\n",
167+
"\toutput: 23339.560546875\n",
161168
"\tbatch: <class 'tuple'>\n",
162169
"\tmetrics: <class 'dict'>\n",
163170
"\tdataloader: <class 'generator'>\n",
164171
"\tseed: <class 'NoneType'>\n",
165172
"\ttimes: <class 'dict'>"
166173
]
167174
},
168-
"execution_count": 3,
175+
"execution_count": null,
169176
"metadata": {},
170177
"output_type": "execute_result"
171178
}
@@ -185,14 +192,24 @@
185192
},
186193
{
187194
"cell_type": "code",
188-
"execution_count": 4,
195+
"execution_count": null,
189196
"metadata": {
190197
"pycharm": {
191198
"name": "#%%\n"
192199
},
193200
"tags": []
194201
},
195202
"outputs": [
203+
{
204+
"name": "stdout",
205+
"output_type": "stream",
206+
"text": [
207+
"2023-01-20 14:16:00,208 - Engine run starting with max_epochs=2.\n",
208+
"2023-01-20 14:16:01,364 - Epoch[1] Complete. Time taken: 00:00:01.154\n",
209+
"2023-01-20 14:16:01,391 - Epoch[2] Complete. Time taken: 00:00:00.026\n",
210+
"2023-01-20 14:16:01,391 - Engine run complete. Time taken: 00:00:01.181\n"
211+
]
212+
},
196213
{
197214
"data": {
198215
"text/plain": [
@@ -201,15 +218,15 @@
201218
"\tepoch: 2\n",
202219
"\tepoch_length: 2\n",
203220
"\tmax_epochs: 2\n",
204-
"\toutput: 30694.720703125\n",
221+
"\toutput: 22608.560546875\n",
205222
"\tbatch: <class 'tuple'>\n",
206223
"\tmetrics: <class 'dict'>\n",
207224
"\tdataloader: <class 'generator'>\n",
208225
"\tseed: <class 'NoneType'>\n",
209226
"\ttimes: <class 'dict'>"
210227
]
211228
},
212-
"execution_count": 4,
229+
"execution_count": null,
213230
"metadata": {},
214231
"output_type": "execute_result"
215232
}
@@ -229,13 +246,23 @@
229246
},
230247
{
231248
"cell_type": "code",
232-
"execution_count": 6,
249+
"execution_count": null,
233250
"metadata": {
234251
"pycharm": {
235252
"name": "#%%\n"
236253
}
237254
},
238255
"outputs": [
256+
{
257+
"name": "stdout",
258+
"output_type": "stream",
259+
"text": [
260+
"2023-01-20 14:16:01,402 - Engine run starting with max_epochs=2.\n",
261+
"2023-01-20 14:16:01,475 - Epoch[1] Complete. Time taken: 00:00:00.073\n",
262+
"2023-01-20 14:16:01,575 - Epoch[2] Complete. Time taken: 00:00:00.100\n",
263+
"2023-01-20 14:16:01,576 - Engine run complete. Time taken: 00:00:00.174\n"
264+
]
265+
},
239266
{
240267
"data": {
241268
"text/plain": [
@@ -244,15 +271,15 @@
244271
"\tepoch: 2\n",
245272
"\tepoch_length: 2\n",
246273
"\tmax_epochs: 2\n",
247-
"\toutput: 26988.939453125\n",
274+
"\toutput: 21955.39453125\n",
248275
"\tbatch: <class 'tuple'>\n",
249276
"\tmetrics: <class 'dict'>\n",
250277
"\tdataloader: <class 'generator'>\n",
251278
"\tseed: <class 'NoneType'>\n",
252279
"\ttimes: <class 'dict'>"
253280
]
254281
},
255-
"execution_count": 6,
282+
"execution_count": null,
256283
"metadata": {},
257284
"output_type": "execute_result"
258285
}
@@ -281,7 +308,7 @@
281308
"name": "python",
282309
"nbconvert_exporter": "python",
283310
"pygments_lexer": "ipython3",
284-
"version": "3.8.10"
311+
"version": "3.8.13"
285312
}
286313
},
287314
"nbformat": 4,

0 commit comments

Comments
 (0)