Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bhashemian authored Oct 10, 2024
2 parents 702e227 + 8ef8770 commit 75f6687
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
3 changes: 2 additions & 1 deletion models/pathology_tumor_detection/configs/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20220324.json",
"version": "0.6.1",
"version": "0.6.2",
"changelog": {
"0.6.2": "enhance readme for nccl timout issue",
"0.6.1": "fix multi-gpu issue",
"0.6.0": "use monai 1.4 and update large files",
"0.5.9": "update to use monai 1.3.1",
Expand Down
4 changes: 2 additions & 2 deletions models/pathology_tumor_detection/configs/train.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"_target_": "DataLoader",
"dataset": "@train#dataset",
"batch_size": 128,
"pin_memory": true,
"pin_memory": false,
"num_workers": 8
},
"inferer": {
Expand Down Expand Up @@ -325,7 +325,7 @@
"_target_": "DataLoader",
"dataset": "@validate#dataset",
"batch_size": 128,
"pin_memory": true,
"pin_memory": false,
"shuffle": false,
"num_workers": 8
},
Expand Down
8 changes: 8 additions & 0 deletions models/pathology_tumor_detection/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ torchrun --standalone --nnodes=1 --nproc_per_node=2 -m monai.bundle run --config

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).

**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:

- Reduce the `num_workers`: Decreasing the number of data loader workers can help minimize these errors.
- Set `pin_memory` to `False`: Disabling pinned memory may reduce the likelihood of timeouts.
- Switch to the `gloo` backend: As a workaround, you can set the distributed training backend to `gloo` to avoid NCCL-related timeouts.

You can implement these settings by adding flags like `--train#dataloader#num_workers 0` or `--train#dataloader#pin_memory false`.

#### Execute inference

```
Expand Down
3 changes: 2 additions & 1 deletion models/vista2d/configs/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"schema": "https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/meta_schema_20240725.json",
"version": "0.2.9",
"version": "0.3.0",
"changelog": {
"0.3.0": "update readme",
"0.2.9": "fix unsupported data dtype in findContours",
"0.2.8": "remove relative path in readme",
"0.2.7": "enhance readme",
Expand Down
14 changes: 10 additions & 4 deletions models/vista2d/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,27 @@ The default dataset for training, validation, and inference is the [Cellpose](ht
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.

### Dependencies
Please refer to `required_packages_version` in `configs/metadata.json` to install all necessary dependencies before executing.
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.

```
pip install fastremap==1.15.0 roifile==2024.5.24 natsort==8.4.0
pip install --no-deps cellpose
```

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

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

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

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

Alternatively, you can use the following command to install `cellpose` without its dependencies:
Alternatively, you can install `cellpose` without its dependencies to avoid potential conflicts:

```
pip install --no-deps cellpose
Expand Down

0 comments on commit 75f6687

Please sign in to comment.