#588 - Pediatric Abdominal CT Segmentation Bundle
Description
This is a submission for the MONAI Bundle of a Pediatric Abdominal CT Segmentation model from the Children's Artificial Intelligence Imaging Research (CAIIR) Center at Cincinnati Children's Hospital.
Metadata check passed, torchdynamo could not install / run during code-formatting script check. Open to any fixes or alternatives for code-formatting check / confirmation. Please feel free to write any questions, comments or suggestions.
Status
Ready for Feedback / Publication
Please ensure all the checkboxes:
- [ ] Codeformat tests passed locally by running
./runtests.sh --codeformat. - [x] In-line docstrings updated.
- [x] Update
versionandchangeloginmetadata.jsonif changing an existing bundle. - [x] Please ensure the naming rules in config files meet our requirements (please refer to:
CONTRIBUTING.md). - [x] Ensure versions of packages such as
monai,pytorchandnumpyare correct inmetadata.json. - [x] Descriptions should be consistent with the content, such as
eval_metricsof the provided weights and TorchScript modules. - [x] Files larger than 25MB are excluded and replaced by providing download links in
large_files.yml. - [x] Avoid using path that contains personal information within config files (such as use
/home/your_name/for"bundle_root").
Hi @EmergentBehaviour , could you check the failed CI tests? Thanks!
Hi @EmergentBehaviour , could you check the failed CI tests? Thanks!
Hello, I've since fixed the dependency versioning that caused the pre-merge to fail, however running some of the ci tests locally (like that contained within ci/run_regular_tests_cpu.sh) have errors with the checksum to download the latest bundles:
Traceback (most recent call last):
File "/workspace/model-zoo/ci/download_latest_bundle.py", line 44, in
Is there something I can do to fix this?
Awaiting review unless there's a way to run blossom on my end.
hi @EmergentBehaviour sorry for the delay. I've run the other tests but can't invoke blossom, there are some things to fix still it seems but then @KumoLiu can trigger the blossom tests. Thanks!
HI @EmergentBehaviour , as for the code format check, the current error is:
ERROR: /home/runner/work/model-zoo/model-zoo/models/pediatric_abdominal_ct_segmentation/scripts/compute_metric.py Imports are incorrectly sorted and/or formatted.
Could you use isort to adjust the import order to fix it? Thanks!
As for the premerge cpu check, since your bundle does not have model.pt, could you add the bundle name into:
https://github.com/Project-MONAI/model-zoo/blob/dev/ci/bundle_custom_data.py#L26
You can also see the contributing guide: https://github.com/Project-MONAI/model-zoo/blob/dev/CONTRIBUTING.md#preferred-files-and-keys Thanks! @EmergentBehaviour
Thank you for the response, and I have made the according modifications. However, this will still not pass the code format test as when the codebase is formatted to conform with isort, there are issues with the black standard according to the code formatting check, and vice versa, despite having used fixes that should in theory keep both standards compliant.
Let me know if there's anything I can do to ameliorate this or if you've run across this with the code formatting scripts.
/black
Thank you for the response, and I have made the according modifications. However, this will still not pass the code format test as when the codebase is formatted to conform with isort, there are issues with the black standard according to the code formatting check, and vice versa, despite having used fixes that should in theory keep both standards compliant.
Let me know if there's anything I can do to ameliorate this or if you've run across this with the code formatting scripts.
Hi @EmergentBehaviour , I pushed a commit and solves the isort and black issues. You can also do that locally via running:
./runtests.sh --autofix
There are still flake8 issues: https://github.com/Project-MONAI/model-zoo/actions/runs/9952935547/job/27495300660?pr=589#step:7:90 like:
/home/runner/work/model-zoo/model-zoo/models/pediatric_abdominal_ct_segmentation/scripts/compute_metric.py:39:1: F401 'argparse' imported but unused
/home/runner/work/model-zoo/model-zoo/models/pediatric_abdominal_ct_segmentation/scripts/compute_metric.py:41:1: F401 'glob.glob' imported but unused
/home/runner/work/model-zoo/model-zoo/models/pediatric_abdominal_ct_segmentation/scripts/compute_metric.py:43:1: F401 'nibabel as nib' imported but unused
/home/runner/work/model-zoo/model-zoo/models/pediatric_abdominal_ct_segmentation/scripts/compute_metric.py:44:1: F401 'numpy as np' imported but unused
/home/runner/work/model-zoo/model-zoo/models/pediatric_abdominal_ct_segmentation/scripts/compute_metric.py:47:1: F401 'monai.data.create_test_image_3d' imported but unused
/home/runner/work/model-zoo/model-zoo/models/pediatric_abdominal_ct_segmentation/scripts/compute_metric.py:50:1: F401 'monai.transforms.KeepLargestConnectedComponentd' imported but unused
/home/runner/work/model-zoo/model-zoo/models/pediatric_abdominal_ct_segmentation/scripts/compute_metric.py:50:1: F401 'monai.transforms.ScaleIntensityd' imported but unused
...
could you resolve them?
Just checking to see if blossom will pass. @yiheng-wang-nv
/build
/build
Would there be a reason why blossom shows as failing in this page but successful on its action page? It looks like it skipped the post-processing step but ran it on the dev branch instead around the same time.
Hi @EmergentBehaviour , CI failed when check the .ts file:
[2024-09-03T08:27:40.606Z] Traceback (most recent call last):
[2024-09-03T08:27:40.606Z] File "/home/jenkins/agent/workspace/MONAI-zoo-premerge/ci/verify_bundle.py", line 355, in <module>
[2024-09-03T08:27:40.606Z] verify(bundle, models_path, mode)
[2024-09-03T08:27:40.606Z] File "/home/jenkins/agent/workspace/MONAI-zoo-premerge/ci/verify_bundle.py", line 343, in verify
[2024-09-03T08:27:40.606Z] verify_torchscript(bundle_path, net_id, config_file, model_name, ts_name)
[2024-09-03T08:27:40.606Z] File "/home/jenkins/agent/workspace/MONAI-zoo-premerge/ci/verify_bundle.py", line 219, in verify_torchscript
[2024-09-03T08:27:40.606Z] torch.jit.load(ts_model_path)
[2024-09-03T08:27:40.606Z] File "/home/jenkins/agent/workspace/MONAI-zoo-premerge/model_zoo_venv/lib/python3.10/site-packages/torch/jit/_serialization.py", line 162, in load
[2024-09-03T08:27:40.606Z] cpp_module = torch._C.import_ir_module(cu, str(f), map_location, _extra_files, _restore_shapes) # type: ignore[call-arg]
[2024-09-03T08:27:40.606Z] RuntimeError:
[2024-09-03T08:27:40.606Z] Unknown type name '__torch__.torch.classes.tensorrt.Engine':
[2024-09-03T08:27:40.606Z] File "code/__torch__/monai/networks/nets/dynunet.py", line 4
[2024-09-03T08:27:40.606Z] __parameters__ = []
[2024-09-03T08:27:40.606Z] __buffers__ = []
[2024-09-03T08:27:40.606Z] __torch___monai_networks_nets_dynunet_DynUNet_trt_engine_0x558a0b5a81a0 : __torch__.torch.classes.tensorrt.Engine
[2024-09-03T08:27:40.606Z] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
[2024-09-03T08:27:40.606Z] def forward(input_0: __torch__.monai.networks.nets.dynunet.DynUNet_trt,
[2024-09-03T08:27:40.606Z] input_1: Tensor) -> Tensor:
I also run torch.jit.load locally and met the same issue. May I ask how to use this file?
@yiheng-wang-nv
The TensorRT model should be able to load in as-is or if not can be exported from the .pt file as described in the bundle's README and loaded from that new file. May I ask what version of TensorRT / any particular plugins this test is using?
I can alternatively remove the .ts model from the large files list and leave it as an option for users to export from the .pt if desired, as different users may be using different versions.
@yiheng-wang-nv
The TensorRT model should be able to load in as-is or if not can be exported from the .pt file as described in the bundle's README and loaded from that new file. May I ask what version of TensorRT / any particular plugins this test is using?
I can alternatively remove the .ts model from the large files list and leave it as an option for users to export from the .pt if desired, as different users may be using different versions.
thanks, let me add a minor change to make the check optional
/build