Commit b8fbfc2
authored
6640 fixes data analyzer device fallback (#6658)
Fixes #6640
### Description
the issue was when `device_count==0` fallback to CPU didn't work
```
[2023-06-26T12:57:56.270Z] 2023-06-26 12:57:56,044 - INFO - test_fl compute data statistics on train...
[2023-06-26T12:57:56.270Z] 2023-06-26 12:57:56,044 - INFO - Found 0 GPUs for data analyzing!
[2023-06-26T12:57:56.270Z] Finished test: test_shape_5 (tests.test_varautoencoder.TestVarAutoEncoder) (0.007s)
[2023-06-26T12:57:56.270Z] Starting test: test_get_data_stats_0 (tests.test_fl_monai_algo_stats.TestFLMonaiAlgo)...
[2023-06-26T12:57:56.526Z]
0%| | 0/2 [00:00<?, ?it/s]2023-06-26 12:57:56,326 - INFO - Unable to process data /home/jenkins/agent/workspace/Monai-pytorch-versions/tests/testing_data/anatomical.nii on cuda:0. No CUDA GPUs are available
[2023-06-26T12:57:56.526Z] 2023-06-26 12:57:56,326 - INFO - DataAnalyzer `device` set to GPU execution hit an exception. Falling back to `cpu`.
[2023-06-26T13:19:27.823Z]
50%|█████ | 1/2 [00:00<00:00, 3.17it/s]Sending interrupt signal to process
[2023-06-26T13:19:27.824Z] Killing processes
```
### 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: Wenqi Li <[email protected]>1 parent 70e2151 commit b8fbfc2
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
| |||
332 | 335 | | |
333 | 336 | | |
334 | 337 | | |
335 | | - | |
| 338 | + | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
339 | 342 | | |
340 | | - | |
| 343 | + | |
341 | 344 | | |
342 | 345 | | |
343 | 346 | | |
| |||
0 commit comments