Skip to content

fix: update runner.sh and endoscopic notebook for MONAI 1.6 tutorial runner compatibility - #2065

Merged
ericspod merged 12 commits into
Project-MONAI:mainfrom
garciadias:fix/monai_1_6_release_notebooks
Jul 7, 2026
Merged

fix: update runner.sh and endoscopic notebook for MONAI 1.6 tutorial runner compatibility#2065
ericspod merged 12 commits into
Project-MONAI:mainfrom
garciadias:fix/monai_1_6_release_notebooks

Conversation

@garciadias

@garciadiasgarciadias commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes tutorial runner failures observed during MONAI 1.6 release testing (Docker image, Python 3.12, RTX 5090). Full diagnostics in this comment.

Depends on Project-MONAI/MONAI#8912
That PR updates the MONAI Docker image (Dockerfile + requirements-dev.txt) with the environment fixes that several tutorials here rely on: it pins mlflow<3.0 (fixes R1 — 4 mlflow-using notebooks that fail on Python 3.12), pins transformers<5.0 (fixes R3 — torch.float8_e8m0fnu missing in the base PyTorch build), adds aim (fixes R6 — spleen segmentation AIM tutorial), and adds lightning>=2.0 as a declared dependency. Without #8912 the Docker image still installs broken versions of those packages, so those tutorial failures persist regardless of the changes in this PR.

Failures addressed

IDRoot causeAffected notebookFix appliedNeeds #8912
R1mlflow 3.x fails on Python 3.12 (from .. import zipp relative import)4 mlflow-using notebooksPin mlflow<3.0 in requirements-dev.txt✅ Fixed in #8912
R3transformers 5.x references torch.float8_e8m0fnu absent in the base PyTorch build2d_regression/image_restoration.ipynb (transitively)Pin transformers<5.0 in requirements-dev.txt✅ Fixed in #8912
R4monai.networks.nets.restormer not present in this branch2d_regression/image_restoration.ipynbAdded to skip_run_papermill in runner.sh
R5monai.bundle.load() returns OrderedDict in older local branch — local-only issue; upstream MONAI ≥1.5 already returns nn.Module by defaultcomputer_assisted_intervention/endoscopic_inbody_classification.ipynbReverted erroneous return_state_dict=False kwarg; original notebook is correct
R6aim package not installed in the Docker imagemodules/spleen_segmentation_aim.ipynbAdd aim to requirements-dev.txt✅ Fixed in #8912
R7pytorch-lightning~=2.0.0 (resolves to 2.0.9) eagerly imports mlflow at module level; mlflow 3.x fails on Python 3.12 with a relative-import errorbundle/05_spleen_segmentation_lightning.ipynbPinned pytorch-lightning>=2.1 in notebook (removes the eager mlflow import; tested with 2.6.5)Partial — #8912 pins mlflow<3.0 as a safety net; this PR removes the fragile import dependency entirely
R9Runner requires all training notebooks to declare max_epochs; two notebooks have nonebundle/msd_crossval_datalist_generator.ipynb, pathology/hovernet_infer_compare.ipynbAdded both to doesnt_contain_max_epochs exemption list in runner.sh
CIdeep_atlas_tutorial.ipynb and 05_spleen_segmentation_lightning.ipynb hardcode device = torch.device("cuda:0") / "cuda" with no CPU fallback; fail on the CPU-only GitHub Actions runnerdeep_atlas/deep_atlas_tutorial.ipynb, bundle/05_spleen_segmentation_lightning.ipynbAdded both to skip_run_papermill in runner.sh
PEP8E225/E231 whitespace violations flagged by pre-commitpreprocess_detect_scene_and_split_fold.ipynb, deep_atlas_tutorial.ipynb, class_lung_lesion.ipynbApplied autopep8 autofix (no functional changes)

Checks

  • Avoid including large-size files in the PR.
  • Clean up long text outputs from code cells in the notebook.
  • For security purposes, please check the contents and remove any sensitive info such as user names and private key.
  • 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> — GPU-dependent notebooks (05_spleen_segmentation_lightning, deep_atlas_tutorial) require a CUDA device; they are skipped in the CPU CI runner and verified manually on a local GPU node.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@coderabbitai

coderabbitaiBot commented Jun 11, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Runner papermill controls updated to exempt two notebooks and skip one; a spleen notebook updates its PyTorch Lightning pin and fixes a JSON outputs block; several notebooks have cosmetic f-string spacing edits; a detailed diagnostics report document is added.

Changes

Notebook Processing Configuration

Layer / File(s)Summary
Notebook exemptions and skip patterns
runner.sh
Lines 87–88 add msd_crossval_datalist_generator.ipynb and hovernet_infer_compare.ipynb to the doesnt_contain_max_epochs exemption list. Line 140 adds image_restoration.ipynb to skip_run_papermill so it is not executed during Papermill runs.
Spleen bundle dependency and outputs fix
bundle/05_spleen_segmentation_lightning.ipynb
Change PyTorch Lightning pip constraint from ~=2.0.0 to >=2.1 (line 41) and remove a redundant/empty outputs JSON block (around line 858).
Notebook f-string spacing fixes
competitions/MICCAI/surgtoolloc/preprocess_detect_scene_and_split_fold.ipynb, deep_atlas/deep_atlas_tutorial.ipynb
Whitespace-only formatting changes in f-strings/boolean expressions at lines ~401, 1258, 1800, 2323; no behavioral changes.
Diagnostics report
diagnose_1_6_release.md
Adds a comprehensive diagnostics report covering test outcomes, failure categories (PEP8, MissingKeyword, ExecutionError), environment notes, rerun results and remediation groups R1–R9, recommended next steps, and fixes applied (lines 1–453).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Project-MONAI/tutorials#2063: Both PRs modify runner.sh to extend papermill handling by adding notebook entries to exemption and/or skip lists.

Suggested reviewers

  • Nic-Ma
  • KumoLiu
  • ericspod
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title accurately summarizes the main changes: updates to runner.sh and the endoscopic notebook for MONAI 1.6 compatibility.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description check✅ PassedThe PR includes the required Description and Checks sections and provides detailed context; only the issue-reference placeholder is not fully filled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@runner.sh`:
- Around line 87-88: The doesnt_contain_max_epochs array entry is incorrect
because hovernet_infer_compare.ipynb does not exist; update the array (variable
doesnt_contain_max_epochs) to reference the actual notebook that lacks
max_epochs — replace hovernet_infer_compare.ipynb with
monailabel/monailabel_pathology_HoVerNet_QuPath.ipynb (or remove the nonexistent
entry) so the basename comparison ([[ "$e" == "$filename" ]]) can correctly
match and exempt the HoverNet inference notebook; ensure the
msd_crossval_datalist_generator.ipynb entry remains unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 790edfde-41e1-40f1-9d11-a3eb3d3813d6

📥 Commits

Reviewing files that changed from the base of the PR and between 7bedfd0 and 22cb7bc.

📒 Files selected for processing (2)
  • computer_assisted_intervention/endoscopic_inbody_classification.ipynb
  • runner.sh
👮 Files not reviewed due to content moderation or server errors (1)
  • computer_assisted_intervention/endoscopic_inbody_classification.ipynb

Comment threadrunner.sh Outdated

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
bundle/05_spleen_segmentation_lightning.ipynb (1)

41-41: ⚡ Quick win

Critical fix for Python 3.12 mlflow import chain failure — well documented.

This change resolves the issue where pytorch-lightning 2.0.x eagerly imports mlflow at module level, causing failures under Python 3.12. The >=2.1 constraint ensures lazy mlflow imports are used.

Optional: Consider a more conservative version constraint

The current constraint >=2.1 permits any future major version (3.x, 4.x, etc.), which could introduce breaking changes. For better stability, consider:

-!pip install -q pytorch-lightning>=2.1+!pip install -q "pytorch-lightning>=2.1,<3"

However, since this is tutorial code and has been tested with 2.6.5, the current permissive constraint is acceptable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@bundle/05_spleen_segmentation_lightning.ipynb` at line 41, Replace the
notebook installation line string "!pip install -q pytorch-lightning>=2.1" with
a constrained version to avoid Python 3.12 mlflow import issues; update the
command in the cell that currently contains "!pip install -q
pytorch-lightning>=2.1" to either "!pip install -q
'pytorch-lightning>=2.1,<3.0'" for a conservative pin or keep ">=2.1" if you
accept the permissive range, ensuring the cell is updated accordingly.
diagnose_1_6_release.md (2)

259-263: 💤 Low value

Add language identifier to fenced code block.

The error message block should specify a language for proper syntax highlighting and markdown validation.

📝 Suggested fix
 `mlflow 3.13.0` (installed in the image) fails on Python 3.12 with:
-```+```python
ImportError: attempted relative import beyond top-level package

</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @diagnose_1_6_release.md around lines 259 - 263, Update the fenced code block
that contains the ImportError message so it includes a language identifier;
replace the opening "" before the "ImportError: attempted relative import beyond top-level package" line with "python" (the block referencing
mlflow.utils.uv_utils and the relative import error) to enable proper syntax
highlighting and markdown validation.


</details>
<!-- cr-comment:v1:a0bf915188f7b1372abe3425 -->
---
`54-66`: _⚡ Quick win_
**Minor documentation gap: second notebook not listed.**
The PR objectives state that both `msd_crossval_datalist_generator.ipynb` and `hovernet_infer_compare.ipynb` were added to the `doesnt_contain_max_epochs` exemption list, but this Category 2 section only documents `msd_crossval_datalist_generator.ipynb`. Line 438 in the "Fixes Applied" section confirms both notebooks were added to the exemption list.
Consider adding `hovernet_infer_compare.ipynb` to the table in this section for completeness, or add a note explaining why it's not listed here (e.g., if it didn't fail in the initial run).
<details>
<summary>🤖 Prompt for AI Agents</summary>
```
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@diagnose_1_6_release.md` around lines 54 - 66, The Category 2 —
MissingKeyword table is missing hovernet_infer_compare.ipynb even though the
"Fixes Applied" (line ~438) shows both msd_crossval_datalist_generator.ipynb and
hovernet_infer_compare.ipynb were added to the doesnt_contain_max_epochs
exemption; update the Category 2 table to include hovernet_infer_compare.ipynb
with the same detail entry (or add a clarifying note why it was omitted), and
ensure the documentation references the runner.sh doesnt_contain_max_epochs
exemption so readers can reconcile the table with the applied fixes.
```
</details>
<!-- cr-comment:v1:7bda2fd71a0aac0f57c28c85 -->
</blockquote></details>
</blockquote></details>
<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @diagnose_1_6_release.md:

  • Around line 444-450: Remove the duplicate "PEP8 in 3 notebooks" entry from the
    "Still pending" section and ensure the "Recommended Next Steps" section keeps
    the existing "PEP8 autofix — all three notebooks autofixed with runner.sh --autofix. ✓ DONE" text; specifically delete the table row or bullet that
    contains the exact phrase "PEP8 in 3 notebooks" (and any associated action text)
    so the document no longer shows PEP8 fixes as both pending and done, keeping
    references to the affected notebooks
    (surgtoolloc/preprocess_detect_scene_and_split_fold.ipynb,
    deep_atlas/deep_atlas_tutorial.ipynb,
    modules/interpretability/class_lung_lesion.ipynb) only in the completed note
    if needed.

Nitpick comments:
In @bundle/05_spleen_segmentation_lightning.ipynb:

  • Line 41: Replace the notebook installation line string "!pip install -q
    pytorch-lightning>=2.1" with a constrained version to avoid Python 3.12 mlflow
    import issues; update the command in the cell that currently contains "!pip
    install -q pytorch-lightning>=2.1" to either "!pip install -q
    'pytorch-lightning>=2.1,<3.0'" for a conservative pin or keep ">=2.1" if you
    accept the permissive range, ensuring the cell is updated accordingly.

In @diagnose_1_6_release.md:

  • Around line 259-263: Update the fenced code block that contains the
    ImportError message so it includes a language identifier; replace the opening
    "" before the "ImportError: attempted relative import beyond top-level package" line with "python" (the block referencing mlflow.utils.uv_utils and
    the relative import error) to enable proper syntax highlighting and markdown
    validation.
  • Around line 54-66: The Category 2 — MissingKeyword table is missing
    hovernet_infer_compare.ipynb even though the "Fixes Applied" (line ~438) shows
    both msd_crossval_datalist_generator.ipynb and hovernet_infer_compare.ipynb were
    added to the doesnt_contain_max_epochs exemption; update the Category 2 table to
    include hovernet_infer_compare.ipynb with the same detail entry (or add a
    clarifying note why it was omitted), and ensure the documentation references the
    runner.sh doesnt_contain_max_epochs exemption so readers can reconcile the table
    with the applied fixes.

</details>
<details>
<summary>🪄 Autofix (Beta)</summary>
Fix all unresolved CodeRabbit comments on this PR:
- [ ] <!-- {"checkboxId": "4b0d0e0a-96d7-4f10-b296-3a18ea78f0b9"} --> Push a commit to this branch (recommended)
- [ ] <!-- {"checkboxId": "ff5b1114-7d8c-49e6-8ac1-43f82af23a33"} --> Create a new PR with the fixes
</details>
---
<details>
<summary>ℹ️ Review info</summary>
<details>
<summary>⚙️ Run configuration</summary>
**Configuration used**: Organization UI
**Review profile**: CHILL
**Plan**: Pro
**Run ID**: `a3e94dda-8fe0-49e3-9b18-8009fe13d5e2`
</details>
<details>
<summary>📥 Commits</summary>
Reviewing files that changed from the base of the PR and between 22cb7bc89c659084d8288f01d6c74391d2e057e6 and f2e31eadb78677e35c1bb004cc6de52a66aaf3a7.
</details>
<details>
<summary>📒 Files selected for processing (5)</summary>
* `bundle/05_spleen_segmentation_lightning.ipynb`
* `competitions/MICCAI/surgtoolloc/preprocess_detect_scene_and_split_fold.ipynb`
* `deep_atlas/deep_atlas_tutorial.ipynb`
* `diagnose_1_6_release.md`
* `modules/interpretability/class_lung_lesion.ipynb`
</details>
<details>
<summary>✅ Files skipped from review due to trivial changes (2)</summary>
* competitions/MICCAI/surgtoolloc/preprocess_detect_scene_and_split_fold.ipynb
* deep_atlas/deep_atlas_tutorial.ipynb
</details>
<details>
<summary>👮 Files not reviewed due to content moderation or server errors (1)</summary>
* modules/interpretability/class_lung_lesion.ipynb
</details>
</details>
<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment threaddiagnose_1_6_release.md Outdated
garciadiasand others added 5 commits June 11, 2026 14:09
…lity
Add msd_crossval_datalist_generator.ipynb and hovernet_infer_compare.ipynb to
doesnt_contain_max_epochs (inference/datalist notebooks with no training loop).
Skip image_restoration.ipynb until monai.networks.nets.Restormer is merged into
the dev branch.
Fix endoscopic_inbody_classification notebook: pass return_state_dict=False to
monai.bundle.load so it returns an nn.Module rather than a raw OrderedDict, which
caused AttributeError on .train() with MONAI 1.6 API.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
for more information, see https://pre-commit.ci
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
- competitions/MICCAI/surgtoolloc/preprocess_detect_scene_and_split_fold.ipynb: E225
- deep_atlas/deep_atlas_tutorial.ipynb: E225
- modules/interpretability/class_lung_lesion.ipynb: E231 in f-string indexing
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
…g pin
pytorch-lightning~=2.0.0 (2.0.9) imports mlflow at module level via
pytorch_lightning.loggers.mlflow; mlflow 3.13.0 fails to initialize
under Python 3.12, making `import pytorch_lightning` fail in the
training subprocess.
pytorch-lightning>=2.1 uses lazy mlflow imports; confirmed working
with 2.6.5: training and evaluation run to completion.
Also documents the root cause in diagnose_1_6_release.md: two-part
R7 issue (fd-limit download truncation + mlflow/pl import chain).
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
- Revert return_state_dict=False from endoscopic_inbody_classification.ipynb:
the upstream MONAI dev (≥1.5) removed the deprecated param entirely and
load() now returns nn.Module by default. The extra kwarg caused a TypeError
in CI. The original notebook is correct for MONAI ≥1.5.
- Update diagnose_1_6_release.md:
- R5: clarify it is a local-only issue (our MONAI @ 19cab577 still has the
deprecated return_state_dict=True default; upstream dev does not)
- R8: mark confirmed fixed — isolated run with --ulimit nofile=65536:65536
completed all 39 cells in 3m1s with no ancdata error (2026-06-11)
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
@garciadias
garciadiasforce-pushed the fix/monai_1_6_release_notebooks branch from 9f83ff4 to f3f49ffCompareJune 11, 2026 13:09
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
diagnose_1_6_release.md (1)

452-452: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Duplicate finding: PEP8 entry should be removed from "Still pending" section.

Line 452 lists "PEP8 in 3 notebooks" as an action still needed, but lines 398 and 420 both mark PEP8 autofix as "✓ DONE". The review stack context confirms that PEP8 f-string spacing fixes were applied to all three notebooks in this PR.

This inconsistency was already flagged in a previous review comment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@diagnose_1_6_release.md` at line 452, Remove the duplicate "PEP8 in 3
notebooks | Run `bash runner.sh --autofix` for
`surgtoolloc/preprocess_detect_scene_and_split_fold.ipynb`,
`deep_atlas/deep_atlas_tutorial.ipynb`,
`modules/interpretability/class_lung_lesion.ipynb`" row from the "Still pending"
section in diagnose_1_6_release.md (the entry that lists "PEP8 in 3 notebooks"),
since those notebooks are already marked "✓ DONE" elsewhere; keep the completed
entries and ensure only the completed PEP8 autofix rows remain.
🧹 Nitpick comments (1)
diagnose_1_6_release.md (1)

259-261: 💤 Low value

Add language specifier to fenced code block.

The fenced code block at line 259 is missing a language specifier. Consider adding text or python to improve readability and satisfy Markdown linting rules.

📝 Proposed fix
-```+```text
ImportError: attempted relative import beyond top-level package
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @diagnose_1_6_release.md around lines 259 - 261, The fenced code block
containing "ImportError: attempted relative import beyond top-level package" is
missing a language specifier; update the opening fence from totext (or

changetheopeningfenceto```textandleavethecontentandclosingfenceunchanged).

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@diagnose_1_6_release.md`:
- Line 452: Remove the duplicate "PEP8 in 3 notebooks | Run `bash runner.sh
--autofix` for `surgtoolloc/preprocess_detect_scene_and_split_fold.ipynb`,
`deep_atlas/deep_atlas_tutorial.ipynb`,
`modules/interpretability/class_lung_lesion.ipynb`" row from the "Still pending"
section in diagnose_1_6_release.md (the entry that lists "PEP8 in 3 notebooks"),
since those notebooks are already marked "✓ DONE" elsewhere; keep the completed
entries and ensure only the completed PEP8 autofix rows remain.
---
Nitpick comments:
In `@diagnose_1_6_release.md`:
- Around line 259-261: The fenced code block containing "ImportError: attempted
relative import beyond top-level package" is missing a language specifier;
update the opening fence from ``` to ```text (or ```python if preferred) so the
block becomes a labeled fenced code block (e.g., change the opening fence to
```text and leave the content and closing fence unchanged).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0bb72274-f31b-4261-9885-6fd6814a3de1

📥 Commits

Reviewing files that changed from the base of the PR and between 9f83ff4 and a581217.

📒 Files selected for processing (7)
  • bundle/05_spleen_segmentation_lightning.ipynb
  • competitions/MICCAI/surgtoolloc/preprocess_detect_scene_and_split_fold.ipynb
  • computer_assisted_intervention/endoscopic_inbody_classification.ipynb
  • deep_atlas/deep_atlas_tutorial.ipynb
  • diagnose_1_6_release.md
  • modules/interpretability/class_lung_lesion.ipynb
  • runner.sh
✅ Files skipped from review due to trivial changes (1)
  • deep_atlas/deep_atlas_tutorial.ipynb
🚧 Files skipped from review as they are similar to previous changes (3)
  • runner.sh
  • bundle/05_spleen_segmentation_lightning.ipynb
  • competitions/MICCAI/surgtoolloc/preprocess_detect_scene_and_split_fold.ipynb
👮 Files not reviewed due to content moderation or server errors (2)
  • modules/interpretability/class_lung_lesion.ipynb
  • computer_assisted_intervention/endoscopic_inbody_classification.ipynb

The notebook calls .to(device) where device is CUDA unconditionally;
no CPU fallback exists. Fails with AssertionError: Torch not compiled
with CUDA enabled on the CPU-only GitHub Actions runner.
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
deep_atlas_tutorial.ipynb hardcodes device = torch.device("cuda:0") with no
CPU fallback; fails with AssertionError: Torch not compiled with CUDA enabled
on the CPU-only GitHub Actions runner.
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
…ax_epochs; fix stale pending table
- runner.sh: hovernet_infer_compare.ipynb does not exist in the repo;
the exemption was a dead entry that could never match. Removed.
- diagnose_1_6_release.md: PEP8 row removed from the 'Still pending'
table (autofix was already applied and marked done at line 401).
Also updated runner.sh change summary to reflect the actual skip list
entries (deep_atlas_tutorial, 05_spleen_segmentation_lightning).
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
@garciadias
garciadias requested a review from ericspodJune 12, 2026 07:55
…r.sh
--jobs N (default 1, backwards-compatible):
Runs N notebooks concurrently via background subshells + wait -n
semaphore. Per-notebook stdout/stderr goes to an isolated temp log;
logs are printed in original notebook order after all jobs finish.
Recommended value for download-heavy runs: 4-8. Use --jobs 1 when
notebooks do conflicting pip installs (e.g. GPU-training notebooks).
--data-dir PATH:
Exports MONAI_DATA_DIRECTORY=PATH before notebooks run. 109/117
runnable notebooks honour this env var and fall back to a temp dir
when it is absent -- so without it every container run re-downloads
all datasets. Setting it to a bind-mounted host path caches data
permanently.
Typical Docker invocation:
docker run ... \
-v /host/monai_data:/data/monai_cache \
monai_1_6:latest \
bash -c "cd /opt/tutorials && bash runner.sh --jobs 4 --data-dir /data/monai_cache"
Also respects MONAI_DATA_DIRECTORY already set in the environment
(e.g. passed via docker run -e) without requiring --data-dir.
Per-notebook logic extracted into _run_notebook() so both paths share
one implementation; sequential path behaviour is unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
@garciadias
garciadiasforce-pushed the fix/monai_1_6_release_notebooks branch from d599eb7 to 1a760d6CompareJune 24, 2026 08:24
@ericspod

Copy link
Copy Markdown
Member

Hi @garciadias thanks for this huge effort in going through the tutorials thoroughly. Is there remedial work to do still? We merged the PR on core for the Dockerfile updates, does that now address any issue here? I know @vikashg was also looking into the tutorials, so we have thorough testing between you and can reconcile PRs.

@garciadias

Copy link
Copy Markdown
ContributorAuthor

Hi @garciadias thanks for this huge effort in going through the tutorials thoroughly. Is there remedial work to do still? We merged the PR on core for the Dockerfile updates, does that now address any issue here? I know @vikashg was also looking into the tutorials, so we have thorough testing between you and can reconcile PRs.

I think all is done here. If I understand correctly, what @vikashg was proposing was to have an agentic system to self-correct the tutorials in the future, but I think this can be done independently of this PR.

Comment threaddiagnose_1_6_release.md Outdated
Comment threadcomputer_assisted_intervention/endoscopic_inbody_classification.ipynb Outdated
garciadias added a commit to garciadias/tutorials that referenced this pull request Jul 7, 2026
- computer_assisted_intervention/endoscopic_inbody_classification.ipynb:
revert output/execution_count stripping on the training cell; this was
the only diff to the file and the cell's source was otherwise unchanged,
per @ericspod's review comment
@garciadias

Copy link
Copy Markdown
ContributorAuthor

Per @ericspod's feedback, moving the full diagnostics report here instead of committing it to the repo as a standalone file.

MONAI 1.6 Release — Tutorial Test Diagnostics

Date: 2026-06-10
Image:monai_1_6:latest (nvcr.io/nvidia/pytorch:25.03-py3 base)
GPU: NVIDIA RTX 5090 (Blackwell, SM_120, CUDA 12.8)
Python: 3.12 · PyTorch 2.7.0a0 (nv25.03) · NumPy 1.26.4
Runner:bash runner.sh (all tutorials)
Log:runner_output.logs


Summary

CategoryCountNotebooks
Passed~150
Failed — ExecutionError91Papermill failed; specific errors not in log (stderr not captured)
Failed — PEP83Style violations caught by flake8
Failed — MissingKeyword1max_epochs not found and not exempted
Total failures94 events / 93 notebooksclass_lung_lesion.ipynb has both PEP8 + ExecutionError

Important — missing error details: The runner was invoked without 2>&1. Papermill writes
progress and tracebacks to stderr, which was not redirected to runner_output.logs. All
91 ExecutionError notebooks show papermill … -k python3 then immediately Check failed! in
the log with no further detail. To see actual errors, re-run with:

bash runner.sh 2>&1| tee runner_output.logs

Or for a single notebook:

docker --context default run --gpus all --rm \
--entrypoint bash -e NVIDIA_DISABLE_REQUIRE=true \
--ipc=host --ulimit memlock=-1 --ulimit stack=67108864 \
-v /data/rgd/tutorials:/opt/tutorials \
monai_1_6:latest \
-c "cd /opt/tutorials && bash runner.sh --verbose -t <notebook_path> 2>&1"

Category 1 — PEP8 Violations (3 notebooks)

The flake8 check (run via jupytext) fails before papermill is even invoked.
Fix with bash runner.sh --autofix -t <notebook> or apply manually.

NotebookErrorLocation
competitions/MICCAI/surgtoolloc/preprocess_detect_scene_and_split_fold.ipynbE225 missing whitespace around operatorstdin:160:44
deep_atlas/deep_atlas_tutorial.ipynbE225 missing whitespace around operatorstdin:1353:31
modules/interpretability/class_lung_lesion.ipynbE231 missing whitespace after , (two occurrences in f-strings y_pred[0,1] / y_pred[0,0])stdin:358:34, stdin:359:38

Category 2 — MissingKeyword (1 notebook)

The runner requires all training notebooks to declare max_epochs (so it can reduce it to 1
for fast CI). Notebooks that don't have it must be added to the doesnt_contain_max_epochs
exemption list in runner.sh.

NotebookDetail
auto3dseg/notebooks/msd_crossval_datalist_generator.ipynbmax_epochs keyword absent; not in doesnt_contain_max_epochs list

Fix options:

  • Add the notebook filename to doesnt_contain_max_epochs in runner.sh (line ~32), or
  • Add a max_epochs = 1 cell/variable to the notebook.

Category 3 — ExecutionError (91 notebooks)

Papermill returned a non-zero exit code. Specific errors are in stderr (not captured in
runner_output.logs). Sub-grouped by likely root cause.

3a — Generative model training (30 notebooks)

These notebooks train diffusion/VAE/GAN models. Even with max_epochs = 1, they likely fail
because they need either:

  • Pre-trained checkpoint files not present in the container, or
  • Custom dataset paths (e.g. BraTS, TCIA) not mounted.
Notebook
generation/2d_autoencoderkl/2d_autoencoderkl_tutorial.ipynb
generation/2d_ddpm/2d_ddpm_compare_schedulers.ipynb
generation/2d_ddpm/2d_ddpm_inpainting.ipynb
generation/2d_ddpm/2d_ddpm_tutorial.ipynb
generation/2d_ddpm/2d_ddpm_tutorial_ignite.ipynb
generation/2d_ddpm/2d_ddpm_tutorial_v_prediction.ipynb
generation/2d_diffusion_autoencoder/2d_diffusion_autoencoder_tutorial.ipynb
generation/2d_ldm/2d_ldm_tutorial.ipynb
generation/2d_super_resolution/2d_sd_super_resolution.ipynb
generation/2d_super_resolution/2d_sd_super_resolution_lightning.ipynb
generation/2d_vqgan/2d_vqgan_tutorial.ipynb
generation/2d_vqvae/2d_vqvae_tutorial.ipynb
generation/2d_vqvae_transformer/2d_vqvae_transformer_tutorial.ipynb
generation/3d_autoencoderkl/3d_autoencoderkl_tutorial.ipynb
generation/3d_ddpm/3d_ddpm_tutorial.ipynb
generation/3d_ldm/3d_ldm_tutorial.ipynb
generation/3d_vqvae/3d_vqvae_tutorial.ipynb
generation/anomaly_detection/2d_classifierfree_guidance_anomalydetection_tutorial.ipynb
generation/anomaly_detection/anomaly_detection_with_transformers.ipynb
generation/anomaly_detection/anomalydetection_tutorial_classifier_guidance.ipynb
generation/classifier_free_guidance/2d_ddpm_classifier_free_guidance_tutorial.ipynb
generation/controlnet/2d_controlnet.ipynb
generation/image_to_image_translation/tutorial_segmentation_with_ddpm.ipynb
generation/maisi/data/mask_augmentation_example.ipynb
generation/maisi/maisi_train_controlnet_tutorial.ipynb
generation/maisi/maisi_train_diff_unet_tutorial.ipynb
generation/maisi/maisi_train_vae_tutorial.ipynb
generation/realism_diversity_metrics/realism_diversity_metrics.ipynb
generation/spade_gan/spade_gan.ipynb
generation/spade_ldm/spade_ldm_brats.ipynb

3b — 3D segmentation / AutoSeg training (6 notebooks)

These notebooks train segmentation models (Spleen, BraTS, VISTA-3D). They need the
corresponding datasets to be available at the paths assumed by the notebook.

Notebook
3d_segmentation/spleen_segmentation_3d_lightning.ipynb
3d_segmentation/unet_segmentation_3d_ignite.ipynb
auto3dseg/notebooks/auto3dseg_autorunner_ref_api.ipynb
auto3dseg/notebooks/auto3dseg_hello_world.ipynb
auto3dseg/notebooks/ensemble_byoc.ipynb
vista_3d/vista3d_spleen_finetune.ipynb

3c — External service / tool dependency (7 notebooks)

These notebooks require external services (tracking servers, serving frameworks, or desktop
applications) that are not available inside the Docker container.

NotebookService needed
experiment_management/bundle_integrate_mlflow.ipynbMLflow tracking server
experiment_management/spleen_segmentation_mlflow.ipynbMLflow tracking server
experiment_management/spleen_segmentation_aim.ipynbAIM tracking server
deployment/bentoml/mednist_classifier_bentoml.ipynbBentoML serving framework
monailabel/monailabel_vista2d_cell_segmentation_CellProfiler.ipynbMONAILabel server + CellProfiler
modules/omniverse/omniverse_integration.ipynbNVIDIA Omniverse (desktop app)
hugging_face/hugging_face_pipeline_for_monai.ipynbHuggingFace model hub / transformers pipeline

3d — MONAI core modules / data loading (48 notebooks)

These are general-purpose tutorials covering transforms, networks, datasets, and workflows.
Likely failures are data download errors (missing network access or cached data), or import
errors from packages that changed API between versions. Requires 2>&1 re-run to diagnose.

Notebook
2d_regression/image_restoration.ipynb
bundle/05_spleen_segmentation_lightning.ipynb
computer_assisted_intervention/endoscopic_inbody_classification.ipynb
microscopy/multichannel_microscopy_classification.ipynb
modules/2d_inference_3d_volume.ipynb
modules/2d_slices_from_3d_sampling.ipynb
modules/2d_slices_from_3d_training.ipynb
modules/3d_image_transforms.ipynb
modules/UNet_input_size_constraints.ipynb
modules/autoencoder_mednist.ipynb
modules/batch_output_transform.ipynb
modules/bending_energy_diffusion_loss_notes.ipynb
modules/cross_validation_models_ensemble.ipynb
modules/csv_datasets.ipynb
modules/decollate_batch.ipynb
modules/developer_guide.ipynb
modules/dice_loss_metric_notes.ipynb
modules/image_dataset.ipynb
modules/integrate_3rd_party_transforms.ipynb
modules/interpretability/cats_and_dogs.ipynb
modules/interpretability/class_lung_lesion.ipynb(also PEP8)
modules/interpretability/covid_classification.ipynb
modules/inverse_transforms_and_test_time_augmentations.ipynb
modules/jupyter_utils.ipynb
modules/layer_wise_learning_rate.ipynb
modules/lazy_resampling_benchmark.ipynb
modules/lazy_resampling_compose.ipynb
modules/lazy_resampling_functional.ipynb
modules/learning_rate.ipynb
modules/load_medical_images.ipynb
modules/mednist_GAN_tutorial.ipynb
modules/mednist_GAN_workflow_array.ipynb
modules/mednist_GAN_workflow_dict.ipynb
modules/network_api.ipynb
modules/network_contraints/unet_plusplus.ipynb
modules/nifti_read_example.ipynb
modules/postprocessing_transforms.ipynb
modules/public_datasets.ipynb
modules/resample_benchmark.ipynb
modules/tcia_csv_processing.ipynb
modules/torch_compile.ipynb
modules/transforms_demo_2d.ipynb
modules/transforms_metatensor.ipynb
modules/varautoencoder_mednist.ipynb
modules/workflow_profiling.ipynb
patch_inferer/modular_patch_inferer.ipynb
pathology/tumor_detection/ignite/profiling_camelyon_pipeline.ipynb

Environment Notes

Key changes made to the Docker image to reach this test run (from baseline nvcr.io/nvidia/pytorch:25.03-py3):

IssueFix applied
No module named pkg_resources during build (MetricsReloaded, segment-anything)PIP_CONSTRAINT with setuptools<71 propagates to pip's isolated build envs
RTX 5090 SM_120 not supportedRebased from nvcr.io/nvidia/pytorch:24.10-py325.03-py3
torch.patch for ONNX bug (24.10 only)Removed
Python 3.12 markers excluded cucim, transformers, onnxruntimeRemoved python_version <= '3.10' caps in requirements-dev.txt
Container's jupytext==1.16.7 blocked tutorial runnerRebuilt /etc/pip/constraint.txt, kept only numpy==1.26.4 + setuptools<71
Container's isort==6.0.1 conflicted with MONAI's isort<6.0Same constraint file rebuild
NumPy 2.x broke PyTorch's C-extension bridge in DataLoader workersnumpy==1.26.4 pin retained (nv25.03 PyTorch compiled against NumPy 1.x)
GPU allowlist check (NVIDIA_DISABLE_REQUIRE)Launch with -e NVIDIA_DISABLE_REQUIRE=true --entrypoint bash

Working docker run command

docker --context default run --gpus all --rm \
--entrypoint bash \
-e NVIDIA_DISABLE_REQUIRE=true \
--ipc=host --ulimit memlock=-1 --ulimit stack=67108864 --ulimit nofile=65536:65536 \
-v /data/rgd/tutorials:/opt/tutorials \
-v /data/rgd/MONAI:/opt/monai \
monai_1_6:latest \
-c "cd /opt/tutorials && bash runner.sh -t <notebook_path> 2>&1"

--ulimit nofile=65536:65536 is required for modules/public_datasets.ipynb (DataLoader
workers pass file descriptors via Unix sockets; the default container limit of 1024 is too low).
2>&1 captures papermill tracebacks that would otherwise be invisible.


Rerun Results (stderr captured) — 2026-06-11

A targeted rerun of the 80 "our-only" failing notebooks was performed with
2>&1 | tee to capture papermill tracebacks.
Script: run_our_only.sh | Log: runner_output_our_only.logs

Outcome

ResultCount
Passed65
Failed15
Total targeted80

All 30 generation notebooks passed (they download their own small synthetic datasets,
writing ~3.7 GB to tutorials/generation/). The unknown "ExecutionError" group is now
fully explained.

The 15 remaining failures

Group R1 — mlflow 3.13.0 broken on Python 3.12 (4 notebooks)

mlflow 3.13.0 (installed in the image) fails on Python 3.12 with:

ImportError: attempted relative import beyond top-level package

The error originates inside mlflow.utils.uv_utils which performs a relative
from .. import zipp that is invalid at top-level scope in Python 3.12.

NotebookWhere mlflow is used
3d_segmentation/unet_segmentation_3d_ignite.ipynbMLFlowHandler optional import
auto3dseg/notebooks/auto3dseg_hello_world.ipynbbundled train.py imports mlflow
auto3dseg/notebooks/ensemble_byoc.ipynbbundled train.py imports mlflow
experiment_management/spleen_segmentation_mlflow.ipynbdirect import mlflow

Fix: pin mlflow<3.0 in the Dockerfile (or constraint file):

RUN pip install "mlflow<3.0"

Eric passes these notebooks — his environment likely has an older mlflow.

Group R2 — Disk full OSError: [Errno 28] No space left on device (4 notebooks)

During the first rerun the generation notebooks wrote ~3.7 GB to tutorials/generation/,
consuming enough space to cause Errno 28 for subsequent data-downloading notebooks.

NotebookWhat it tried to write
deep_atlas/deep_atlas_tutorial.ipynbOASIS dataset (~2 GB)
deployment/bentoml/mednist_classifier_bentoml.ipynbMedNIST dataset
experiment_management/bundle_integrate_mlflow.ipynbSpleen bundle run artefacts (ran 221 min before failing)
microscopy/multichannel_microscopy_classification.ipynbPre-trained DenseNet169 weights

This is a run-order artifact, not a persistent issue on this host. The root
filesystem has 39 GB free and the 3.7 GB generation datasets are now cached. On
subsequent runs with the generation data already present these notebooks complete
normally — confirmed by rerun on 2026-06-11 (runner_output_rerun_r2r7r8.logs).
Note: bundle_integrate_mlflow also requires the mlflow fix (Group R1) to be in
the rebuilt image before it can complete.

Group R3 — transformers 5.10.2 + PyTorch nv25.03 incompatibility (1 notebook)

transformers 5.10.2 references torch.float8_e8m0fnu which does not exist in
PyTorch 2.7.0a0+nv25.03, causing import of PreTrainedModel to fail.

NotebookError
hugging_face/hugging_face_pipeline_for_monai.ipynbModuleNotFoundError: Could not import module 'PreTrainedModel' (caused by AttributeError: module 'torch' has no attribute 'float8_e8m0fnu')

Fix: Pin transformers<5.0 in constraint file, or wait for nv25 PyTorch update.
Eric's PyTorch 2.12+cu130 supports float8_e8m0fnu; ours does not.

Group R4 — Missing MONAI module (1 notebook)

NotebookError
2d_regression/image_restoration.ipynbModuleNotFoundError: No module named 'monai.networks.nets.restormer'

Restormer is not yet present in our MONAI dev branch (19cab577). Eric is on
eccefc57 (+143 commits) which may already include it, or the notebook needs updating.

Fix: Cherry-pick the Restormer commit into the dev branch, or add the
notebook to skip_run_papermill until the class is merged.

Group R5 — MONAI bundle.load API — local-only issue (1 notebook)

NotebookError (local MONAI dev @ 19cab577 only)
computer_assisted_intervention/endoscopic_inbody_classification.ipynbAttributeError: 'collections.OrderedDict' object has no attribute 'train'

monai.bundle.load() in our local MONAI dev branch (19cab577) has
@deprecated_arg("return_state_dict", since="1.2", removed="1.5") with
return_state_dict=True still active as the default, so it returns an
OrderedDict instead of an nn.Module.

This is a local-environment-only issue. The upstream MONAI dev branch
(eccefc57, used by CI and the upstream Docker image) removed the
return_state_dict parameter in MONAI 1.5, and load() now returns nn.Module
by default. The notebook is correct as-is for any MONAI ≥ 1.5.

No notebook fix needed. The return_state_dict=False workaround that was
previously applied broke CI because the upstream MONAI does not accept that
parameter at all (TypeError: unexpected keyword argument). It has been reverted.

Group R6 — Missing aim package (1 notebook)

NotebookError
experiment_management/spleen_segmentation_aim.ipynbModuleNotFoundError: No module named 'aim'

Fix: Add aim to requirements-dev.txt and reinstall in the image.

Group R7 — pytorch-lightning → mlflow import chain failure (1 notebook)

NotebookError
bundle/05_spleen_segmentation_lightning.ipynbFirst run: ContentTooShortError (89 min download truncated). Rerun with --ulimit nofile=65536:65536: download succeeds in 6 min but training cell fails with OptionalImportError: from scripts.main import train (No module named 'pytorch_lightning').

Root cause chain:

  1. Notebook installs pytorch-lightning~=2.0.0 → installs 2.0.9
  2. pytorch_lightning 2.0.x eagerly imports mlflow at module level (via pytorch_lightning.loggers.mlflow)
  3. mlflow 3.13.0 fails to initialize under Python 3.12 (same R1 root cause)
  4. Result: import pytorch_lightning fails in the %%bash training subprocess

Fix: Change !pip install -q pytorch-lightning~=2.0.0!pip install -q "pytorch-lightning>=2.1".
pytorch-lightning ≥ 2.1 uses lazy mlflow imports; tested with 2.6.5, training and evaluation pass.
The original download truncation (ContentTooShortError) was due to fd limits (R8) and is also resolved with --ulimit nofile=65536:65536.

Group R8 — Socket resource exhaustion (1 notebook)

NotebookError
modules/public_datasets.ipynbRuntimeError: received 0 items of ancdata

PyTorch DataLoader failed to pass file descriptors through Unix sockets between
the main process and worker processes (ancillary data = file-descriptor passing).
This happens when the per-process open-file-descriptor limit is too low
(Docker default: 1024; DataLoader workers need ~65 k).

Fix: Add --ulimit nofile=65536:65536 to the docker run command (already
reflected in the working command above).

Rerun note: The targeted rerun (runner_output_rerun_r2r7r8.logs) ran public_datasets in
the same container as deep_atlas. That notebook pip-installs packages which upgraded urllib3
to 2.x; papermill then failed to import immediately (ModuleNotFoundError: No module named 'urllib3.packages.six.moves') — a run-order contamination, not the ancdata fix being tested.
Confirmed fixed in isolated run (container with --ulimit nofile=65536:65536, no shared
container): all 39 cells passed, real 3m1s. No ancdata error observed.

Group R9 — MissingKeyword (1 notebook)

NotebookError
auto3dseg/notebooks/msd_crossval_datalist_generator.ipynbmax_epochs not found; not in exemption list

Known issue (documented in Category 2 above). Add to doesnt_contain_max_epochs.


Recommended Next Steps

  1. Pin mlflow<3.0 in the Dockerfile — fixes 4 notebooks (Group R1). ✓ DONE (PR #8912)
  2. R2 is a run-order artifact — not applicable on this host (39 GB free, data cached).
  3. --ulimit nofile=65536:65536 added to working docker run command — fixes R8. ✓ DONE (confirmed clean run 3m1s)
  4. PEP8 autofix — all three notebooks autofixed with runner.sh --autofix. ✓ DONE
  5. Fix MissingKeywordmsd_crossval_datalist_generator.ipynb added to exemption list. ✓ DONE (PR fix: update runner.sh and endoscopic notebook for MONAI 1.6 tutorial runner compatibility #2065)
  6. Pin transformers<5.0 — fixes R3. ✓ DONE (PR #8912)
  7. Add aim to requirements-dev.txt — fixes R6. ✓ DONE (PR #8912)
  8. R5 is local-only — no notebook fix needed; upstream MONAI ≥ 1.5 removed the deprecated param and load() returns nn.Module directly. ✓ CONFIRMED (reverted wrong fix)
  9. Skip image_restoration.ipynb until Restormer is merged (R4). ✓ DONE (PR fix: update runner.sh and endoscopic notebook for MONAI 1.6 tutorial runner compatibility #2065)
  10. Fix R7pytorch-lightning>=2.1 pin in bundle/05_spleen_segmentation_lightning.ipynb. ✓ DONE (PR fix: update runner.sh and endoscopic notebook for MONAI 1.6 tutorial runner compatibility #2065)

Priority order

PriorityActionImpactStatus
HighPin mlflow<3.0 (Dockerfile rebuild)+4 passes✓ Done (PR #8912)
HighR2 disk-full+4 passes✓ Not an issue (run-order artifact)
Medium--ulimit nofile=65536:65536 in docker run+1 pass✓ Done (confirmed, 3m1s clean run)
MediumAdd msd_crossval_datalist_generator to exemption+1 pass✓ Done (PR #2065)
MediumPin transformers<5.0+1 pass✓ Done (PR #8912)
LowAdd aim to requirements+1 pass✓ Done (PR #8912)
LowR5 bundle.load API — local-only, no fix needed+1 pass (upstream)✓ Confirmed (reverted bad fix)
LowPEP8 autofix (3 notebooks)0 fails eliminated✓ Done
LowSkip image_restoration.ipynb (Restormer missing)+1 pass✓ Done (PR #2065)
LowFix Spleen Lightning notebook (pytorch-lightning>=2.1)+1 pass✓ Done (PR #2065)

Fixes Applied (2026-06-11)

Changes committed to bring Docker run to parity with Eric's run:

MONAI repo (/data/rgd/MONAI)

FileChange
DockerfileBase image: 24.10-py325.03-py3; rebuild pip constraint file (keep numpy==1.26.4, add setuptools<71); install papermill jupytext autopep8 autoflake ipywidgets; pin mlflow<3.0, transformers<5.0; add aim, lightning>=2.0
requirements-dev.txtPin transformers<5.0; pin mlflow<3.0; add aim; add lightning>=2.0; remove python_version<=3.10 caps from cucim, onnxruntime, transformers

Tutorials repo (/data/rgd/tutorials)

FileChange
runner.shAdd msd_crossval_datalist_generator.ipynb to doesnt_contain_max_epochs; add image_restoration.ipynb, 05_spleen_segmentation_lightning.ipynb, deep_atlas_tutorial.ipynb to skip_run_papermill
computer_assisted_intervention/endoscopic_inbody_classification.ipynbReverted return_state_dict=False — upstream MONAI ≥1.5 already returns nn.Module by default; the extra kwarg caused TypeError in CI
bundle/05_spleen_segmentation_lightning.ipynbChange pytorch-lightning~=2.0.0pytorch-lightning>=2.1 to avoid mlflow eager-import failure (R7)

Still pending (require environment changes or separate PRs)

IssueAction needed
Disk space (R2)Free /data disk or bind-mount scratch volume; deep_atlas (~2 GB), deployment/bentoml, experiment_management/bundle_integrate_mlflow, microscopy notebooks
Socket FD limit (R8)✓ Confirmed fixed — --ulimit nofile=65536:65536 resolves ancdata error; isolated run completed in 3m1s (2026-06-11)
pytorch-lightning/mlflow import chain (R7)✓ Fixed: pytorch-lightning>=2.1 in notebook (PR #2065)
Restormer in MONAI devCherry-pick Restormer network class commit; remove from skip list once merged

@garciadias
garciadias requested a review from ericspodJuly 7, 2026 11:13
garciadiasand others added 2 commits July 7, 2026 12:14
- computer_assisted_intervention/endoscopic_inbody_classification.ipynb:
revert output/execution_count stripping on the training cell; this was
the only diff to the file and the cell's source was otherwise unchanged,
per @ericspod's review comment
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
Full diagnostics report will be posted as a PR comment instead of
committed to the repo.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: R. Garcia-Dias <rafaelagd@gmail.com>
@garciadias
garciadiasforce-pushed the fix/monai_1_6_release_notebooks branch from 2b4687e to 4422157CompareJuly 7, 2026 11:14
@ericspod
ericspod merged commit 81dcf0f into Project-MONAI:mainJul 7, 2026
7 checks passed
@vikashg

Copy link
Copy Markdown
Contributor

@ericspod and @garciadias Is it all completed or you want to me sync this and look at it again ? Sorry I was behind and I generally look at monai stuff on Wed/Thursdays.

@ericspod

Copy link
Copy Markdown
Member

@ericspod and @garciadias Is it all completed or you want to me sync this and look at it again ? Sorry I was behind and I generally look at monai stuff on Wed/Thursdays.

Hi @vikashg you have a PR #2066, did you want to sync that and continue work there? This one was done with no followup to do still.

@coderabbitaicoderabbitaiBot mentioned this pull request Jul 27, 2026
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@garciadias@ericspod@vikashg