You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📝 Update 05-patch-prediction notebook for the New API (#977)
## Summary
This PR updates the patch‑prediction example to align with the new `PatchPredictor` engine and fixes a long‑standing issue in `EngineABC` related to model‑attribute retrieval when using `DataParallel`.
---
## What’s Changed
### 🔧 Example Notebook Updates
- Updated **`examples/05-patch-prediction.ipynb`** to use the new `PatchPredictor` engine API.
- Added a new **“Visualize in TIAViz”** section, allowing readers to directly inspect prediction results inside **TIAViz** for a smoother, more interactive workflow.
### 🐛 EngineABC Bug Fix
- Fixed a bug in **`EngineABC`** where model attributes were incorrectly retrieved from a `DataParallel` wrapper.
- Introduced `_get_model_attr()` to safely unwrap the underlying model when needed.
- This resolves multi‑GPU crashes caused by attributes living on the wrapped module instead of the actual model.
---
## Why This Matters
- Ensures the patch‑prediction example stays up‑to‑date with the latest engine design.
- Improves multi‑GPU stability and prevents confusing attribute‑access errors.
- Enhances the user experience by integrating TIAViz visualization directly into the example workflow.
---
## Testing
- Verified that the updated notebook runs end‑to‑end with the new engine.
- Confirmed that multi‑GPU training and inference no longer crash when accessing model attributes.
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
0 commit comments