Skip to content

Commit 8ef8770

Browse files
authored
Enhance README in vista2d and pathology tumor detection (#695)
- enhance description for the dependency in vista2d - add notes for random nncl timout issue in tumor detection bundle ### Status **Ready** ### Please ensure all the checkboxes: <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Codeformat tests passed locally by running `./runtests.sh --codeformat`. - [ ] In-line docstrings updated. - [ ] Update `version` and `changelog` in `metadata.json` if changing an existing bundle. - [ ] Please ensure the naming rules in config files meet our requirements (please refer to: `CONTRIBUTING.md`). - [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`. - [ ] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules. - [ ] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`. - [ ] Avoid using path that contains personal information within config files (such as use `/home/your_name/` for `"bundle_root"`). --------- Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
1 parent f965839 commit 8ef8770

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

models/pathology_tumor_detection/configs/metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220324.json",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"changelog": {
5+
"0.6.2": "enhance readme for nccl timout issue",
56
"0.6.1": "fix multi-gpu issue",
67
"0.6.0": "use monai 1.4 and update large files",
78
"0.5.9": "update to use monai 1.3.1",

models/pathology_tumor_detection/configs/train.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
"_target_": "DataLoader",
175175
"dataset": "@train#dataset",
176176
"batch_size": 128,
177-
"pin_memory": true,
177+
"pin_memory": false,
178178
"num_workers": 8
179179
},
180180
"inferer": {
@@ -325,7 +325,7 @@
325325
"_target_": "DataLoader",
326326
"dataset": "@validate#dataset",
327327
"batch_size": 128,
328-
"pin_memory": true,
328+
"pin_memory": false,
329329
"shuffle": false,
330330
"num_workers": 8
331331
},

models/pathology_tumor_detection/docs/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ torchrun --standalone --nnodes=1 --nproc_per_node=2 -m monai.bundle run --config
135135

136136
Please note that the distributed training-related options depend on the actual running environment; thus, users may need to remove `--standalone`, modify `--nnodes`, or do some other necessary changes according to the machine used. For more details, please refer to [pytorch's official tutorial](https://pytorch.org/tutorials/intermediate/ddp_tutorial.html).
137137

138+
**Note:** When using a container based on [PyTorch 24.0x](https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes), you may encounter random NCCL timeout errors. To address this issue, consider the following adjustments:
139+
140+
- Reduce the `num_workers`: Decreasing the number of data loader workers can help minimize these errors.
141+
- Set `pin_memory` to `False`: Disabling pinned memory may reduce the likelihood of timeouts.
142+
- Switch to the `gloo` backend: As a workaround, you can set the distributed training backend to `gloo` to avoid NCCL-related timeouts.
143+
144+
You can implement these settings by adding flags like `--train#dataloader#num_workers 0` or `--train#dataloader#pin_memory false`.
145+
138146
#### Execute inference
139147

140148
```

models/vista2d/configs/metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20240725.json",
3-
"version": "0.2.9",
3+
"version": "0.3.0",
44
"changelog": {
5+
"0.3.0": "update readme",
56
"0.2.9": "fix unsupported data dtype in findContours",
67
"0.2.8": "remove relative path in readme",
78
"0.2.7": "enhance readme",

models/vista2d/docs/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,27 @@ The default dataset for training, validation, and inference is the [Cellpose](ht
5252
Additionally, all data lists are available in the `datalists.zip` file located in the root directory of the bundle. Extract the contents of the `.zip` file to access the data lists.
5353

5454
### Dependencies
55-
Please refer to `required_packages_version` in `configs/metadata.json` to install all necessary dependencies before executing.
55+
Please refer to the `required_packages_version` section in `configs/metadata.json` to install all necessary dependencies before execution. If you’re using the MONAI container, you can simply run the commands below and ignore any "opencv-python-headless not installed" error message, as this package is already included in the container.
56+
57+
```
58+
pip install fastremap==1.15.0 roifile==2024.5.24 natsort==8.4.0
59+
pip install --no-deps cellpose
60+
```
5661

5762
Important Note: if your environment already contains OpenCV, installing `cellpose` may lead to conflicts and produce errors such as:
5863

5964
```
6065
AttributeError: partially initialized module 'cv2' has no attribute 'dnn' (most likely due to a circular import)
6166
```
6267

63-
when executing. To resolve this issue, please uninstall OpenCV and then re-install `cellpose` with a command like:
68+
To resolve this, uninstall `OpenCV` first, and then install `cellpose` using the following commands:
6469

6570
```Bash
66-
pip uninstall -y opencv && rm /usr/local/lib/python3.x/dist-packages/cv2
71+
pip uninstall -y opencv && rm /usr/local/lib/python3.*/dist-packages/cv2
6772
```
73+
Make sure to replace 3.* with your actual Python version (e.g., 3.10).
6874

69-
Alternatively, you can use the following command to install `cellpose` without its dependencies:
75+
Alternatively, you can install `cellpose` without its dependencies to avoid potential conflicts:
7076

7177
```
7278
pip install --no-deps cellpose

0 commit comments

Comments
 (0)