Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
163a008
initialize dints tutorials
Nov 19, 2021
ddf8392
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 19, 2021
1a1a58d
update scripts
Nov 22, 2021
f7473d0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 22, 2021
1ba684e
update scripts
Nov 22, 2021
85ee1a0
Merge branch 'master' of https://github.com/dongyang0122/tutorials
Nov 22, 2021
db1cafe
update scripts
Nov 22, 2021
981b303
Update README.md
dongyang0122 Nov 22, 2021
d98ca94
Update README.md
dongyang0122 Nov 22, 2021
3e820fd
update scripts
Nov 22, 2021
dcd4e10
Merge branch 'master' of https://github.com/dongyang0122/tutorials
Nov 22, 2021
0d3c8e7
Change Dints interface
heyufan1995 Nov 22, 2021
b8a3101
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 22, 2021
1981544
Merge branch 'master' of github.com:dongyang0122/tutorials
heyufan1995 Nov 22, 2021
2a5bb06
Modify scripts for new Dints interface
heyufan1995 Nov 22, 2021
fc2f277
Merge branch 'master' of github.com:dongyang0122/tutorials
heyufan1995 Nov 22, 2021
698a9a0
update scripts
Nov 23, 2021
4a44993
update scripts
Nov 24, 2021
8da5dc3
update scripts
Nov 30, 2021
2260ce2
update scripts
Nov 30, 2021
396c1ae
Test push
heyufan1995 Nov 30, 2021
5669d7b
update scripts
Nov 30, 2021
0a1cc78
update scripts
Nov 30, 2021
ee20f21
update scripts
Nov 30, 2021
3122caf
update readme
Nov 30, 2021
6ccdd50
Add readme
heyufan1995 Nov 30, 2021
51f3127
Merge branch 'master' of github.com:dongyang0122/tutorials
heyufan1995 Nov 30, 2021
79c9aab
Update readme
heyufan1995 Nov 30, 2021
d29f086
Change lr in search
heyufan1995 Dec 1, 2021
bdc759e
update readme
Dec 1, 2021
b2b1170
Enable single GPU
heyufan1995 Dec 1, 2021
1c72524
update readme
Dec 1, 2021
cf20e1d
Add visualization tutorial transform image (#448)
Nic-Ma Nov 22, 2021
03990f9
Update spleen_segmentation_3d.ipynb (#455)
nvahmadi Nov 24, 2021
1cb5a90
Figures added, pretrained weights link added, minor fixes (#456)
finalelement Nov 24, 2021
f573bec
Add itkwidgets example in notebook (#454)
Nic-Ma Nov 25, 2021
3f540b4
MIL example (#431)
myron Nov 25, 2021
829b8d5
450 update AsDiscrete (#451)
yiheng-wang-nv Nov 26, 2021
4422cab
459 update nvidia flare 2.0 example (#460)
yiheng-wang-nv Nov 30, 2021
cfbd3d2
Weights Link Updated (#465)
finalelement Dec 1, 2021
f3ea3c9
Merge remote-tracking branch 'upstream/master'
wyli Dec 1, 2021
a845545
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2021
e69a472
fixes readme typos
wyli Dec 1, 2021
cf5594e
Merge remote-tracking branch 'dong/master'
wyli Dec 1, 2021
6fb6b3e
update readmes
wyli Dec 1, 2021
76120b6
update readme
wyli Dec 1, 2021
7d82859
qa commit
wyli Dec 1, 2021
5cebe49
link
wyli Dec 1, 2021
8434a7f
Add plot arch_code utils
heyufan1995 Dec 3, 2021
5f290b6
Fix bugs in search and update readme
heyufan1995 Dec 3, 2021
327c190
Fix combination weights bug
heyufan1995 Dec 4, 2021
a6ee0ad
Small typo update
heyufan1995 Dec 5, 2021
a165628
Fix minor bug in train_dints
heyufan1995 Dec 6, 2021
e94d32e
update scripts
Dec 6, 2021
564a4f9
Merge branch 'master' into update-dints-tutorials
dongyang0122 Dec 6, 2021
d5d87a3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 6, 2021
9c076e1
update scripts
Dec 6, 2021
4417673
update scripts
Dec 6, 2021
c491d83
update scripts
Dec 7, 2021
39dd57d
update scripts
Dec 7, 2021
4260ed2
update scripts
Dec 7, 2021
296a030
Update Readme
heyufan1995 Dec 7, 2021
06e08b7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 7, 2021
0381db6
Merge branch 'master' into update-dints-tutorials
wyli Dec 7, 2021
36f9cff
Change arch code keys
heyufan1995 Dec 7, 2021
5f7e1e8
update scripts
Dec 7, 2021
98721b8
update scripts
Dec 7, 2021
0da21b2
Merge branch 'master' into update-dints-tutorial-v2
dongyang0122 Dec 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions automl/DiNTS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ You can use nvidia docker or conda environments to install the dependencies.
- ### Using Docker Image
1. #### Download and install Nvidia PyTorch Docker
```bash
docker pull nvcr.io/nvidia/pytorch:21.10-py3
docker pull projectmonai/monai:0.8.0
```
2. #### Download the repository
```bash
git clone https://github.com/Project-MONAI/tutorials.git
```
3. #### Run into Docker
```
sudo docker run -it --gpus all --pid=host --shm-size 16G -v /location/to/tutorials/automl/DiNTS/:/workspace/DiNTS/ nvcr.io/nvidia/pytorch:21.10-py3
sudo docker run -it --gpus all --pid=host --shm-size 16G -v /location/to/tutorials/automl/DiNTS/:/workspace/DiNTS/ projectmonai/monai:0.8.0
```
4. #### Install required package in docker
```bash
Expand All @@ -37,6 +37,7 @@ conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
```
2. #### Install MONAI and dependencies
```bash
pip install monai==0.8.0
bash install.sh
```
- ### Install [Graphviz](https://graphviz.org/download/) for visualization (needed in decode_plot.py)
Expand Down Expand Up @@ -68,7 +69,7 @@ python train_dints.py -h
- Change ``NUM_GPUS_PER_NODE`` to your number of GPUs.
- Run `bash search_dints.sh`
- Call the function in `decode_plot.py` to visualize the searched model in a vector image (graphvis needs to be installed).
The searched archtecture with ram cost 0.2 and 0.8 are shown below:
The searched architecture with ram cost 0.2 and 0.8 are shown below:
![0.2 search](./Figures/search_0.2.png)
![0.8 search](./Figures/search_0.8.png)

Expand All @@ -77,7 +78,7 @@ The searched archtecture with ram cost 0.2 and 0.8 are shown below:
```
-v /your_downloaded_data_root/Task09_Spleen/:/workspace/data_msd/Task09_Spleen/
```
- Change ``ARCH_CKPT`` to point to the architecture file (.pth) from the searching stage.
- Change ``ARCH_CKPT`` to point to the architecture file (.pth) from the searching stage. 'arch_code_cvpr.pth' is the searched architecture in DiNTS CVPR2021 paper.
- Change ``NUM_GPUS_PER_NODE`` to your number of GPUs.
- Run `bash train_dints.sh`

Expand Down
Binary file added automl/DiNTS/arch_code_cvpr.pth
Binary file not shown.
3 changes: 1 addition & 2 deletions automl/DiNTS/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ pip install pandas

# Update pip
python -m pip install -U pip

# Install scikit-image
python -m pip install -U scikit-image

pip install git+https://github.com/Project-MONAI/MONAI#egg=monai
3 changes: 1 addition & 2 deletions automl/DiNTS/search_dints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ clear

TASK="Task07_Pancreas"

DATA_ROOT="/home/dongy/Data/MSD/${TASK}"
# DATA_ROOT="/workspace/data_msd/${TASK}"
DATA_ROOT="/workspace/data_msd/${TASK}"
JSON_PATH="${DATA_ROOT}/dataset.json"

FOLD=4
Expand Down
7 changes: 4 additions & 3 deletions automl/DiNTS/train_dints.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,13 @@ def main():
]
)

# train_ds = monai.data.Dataset(data=train_files, transform=train_transforms)
# val_ds = monai.data.Dataset(data=val_files, transform=val_transforms)

train_ds = monai.data.CacheDataset(data=train_files, transform=train_transforms, cache_rate=1.0, num_workers=8)
val_ds = monai.data.CacheDataset(data=val_files, transform=val_transforms, cache_rate=1.0, num_workers=2)

# monai.data.Dataset can be used as alternatives when debugging or RAM space is limited.
# train_ds = monai.data.Dataset(data=train_files, transform=train_transforms)
# val_ds = monai.data.Dataset(data=val_files, transform=val_transforms)

train_loader = ThreadDataLoader(train_ds, num_workers=0, batch_size=num_images_per_batch, shuffle=True)
val_loader = ThreadDataLoader(val_ds, num_workers=0, batch_size=1, shuffle=False)

Expand Down
1 change: 0 additions & 1 deletion automl/DiNTS/train_dints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ clear
TASK="Task09_Spleen"

ARCH_CKPT="arch_code.pth"
# DATA_ROOT="/home/dongy/Data/MSD/${TASK}"
DATA_ROOT="/workspace/data_msd/${TASK}"
JSON_PATH="${DATA_ROOT}/dataset.json"

Expand Down