Commit cb257d2
authored
Add warning in a multiprocessing special case (#6830)
Related to discussion
#6657
This code at least adds a warning if `set_track_meta(False)` and
`multiprocessing_context='spawn'` are used in the same code. However
this warning only triggers if `set_track_meta(False)` has been called
before the DataLoader has been initialized. I will append some example
code where this is not True, still the bug is triggered.
Imo this is still a MONAI bug even though in the discussion it was
claimed otherwise. The multiprocessing_context='spawn' has unintended
consequences and this is only true for MONAI and not for torch. (I
believe the problem is that with 'spawn' Python and all the libs get
reinitialized and thus _TRACK_META is reset to being True).
### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.
---------
Signed-off-by: Matthias Hadlich <[email protected]>1 parent 49a1ae5 commit cb257d2
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
88 | 91 | | |
89 | 92 | | |
90 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
91 | 106 | | |
0 commit comments