hover_net icon indicating copy to clipboard operation
hover_net copied to clipboard

Continuous occurrences of PermissionError

Open mordred-skywalker opened this issue 3 years ago • 1 comments

Hi, while using the inference PanNuke checkpoint, I have been encountering the following problems. Do you have a potential solution for that?

here's my code: py run_infer.py --gpu="0,1" --nr_types=6 --type_info_path="C:\Users\Downloads\hover_net-master\hover_net-master\type_info.json" --batch_size=32 --model_mode=fast --model_path="C:\Users\Downloads\hovernet_fast_pannuke_type_tf2pytorch.tar" --nr_inference_workers=1 --nr_post_proc_workers=8 wsi --input_dir="C:\Users\Downloads\Dataset\sample_wsis" --output_dir="C:\Users\Downloads\Dataset\output" --proc_mag=40 --save_mask --save_thumb

here's the error message: |2022-12-01|06:21:27.509| [INFO] .... Detect #GPUS: 1 |2022-12-01|06:21:29.509| [INFO] ................ Process: 74833 |2022-12-01|06:21:56.497| [INFO] ............ WARNING: No mask found, generating mask via thresholding at 1.25x! |2022-12-01|06:21:57.468| [INFO] ........ Preparing Input Output Placement: 27.9592747 Process Chunk 0/16: 100%|#########################| 1/1 [00:32<00:00, 32.05s/it] Process Chunk 1/16: 100%|#####################| 73/73 [1:19:30<00:00, 65.35s/it] Process Chunk 4/16: 100%|#########################| 1/1 [00:29<00:00, 29.68s/it] Process Chunk 5/16: 100%|#######################| 10/10 [10:32<00:00, 63.29s/it] Process Chunk 6/16: 100%|#######################| 32/32 [34:29<00:00, 64.67s/it] Process Chunk 7/16: 100%|#########################| 5/5 [04:43<00:00, 56.68s/it] Process Chunk 8/16: 100%|#######################| 34/34 [36:08<00:00, 63.77s/it] Process Chunk 9/16: 100%|#######################| 17/17 [17:33<00:00, 61.97s/it] Process Chunk 10/16: 100%|######################| 16/16 [17:21<00:00, 65.08s/it] Process Chunk 11/16: 100%|########################| 1/1 [01:04<00:00, 64.91s/it] |2022-12-01|09:45:00.969| [INFO] ........ Inference Time: 12183.417727600001 Post Proc Phase 1: 100%|########################| 70/70 [00:57<00:00, 1.21it/s] Post Proc Phase 2: 0%| | 0/106 [00:00<?, ?it/s]Traceback (most recent call last): File "", line 1, in Traceback (most recent call last): Traceback (most recent call last): File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main Traceback (most recent call last): File "", line 1, in File "", line 1, in exitcode = _main(fd, parent_sentinel) File "", line 1, in File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main Traceback (most recent call last): File "", line 1, in File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) exitcode = _main(fd, parent_sentinel) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main exitcode = _main(fd, parent_sentinel) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main prepare(preparation_data) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 268, in run_path return _run_module_code(code, init_globals, run_name, prepare(preparation_data) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 236, in prepare prepare(preparation_data) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 236, in prepare prepare(preparation_data) _fixup_main_from_path(data['init_main_from_path']) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 97, in _run_module_code _fixup_main_from_path(data['init_main_from_path']) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 236, in prepare exitcode = _main(fd, parent_sentinel) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main _run_code(code, mod_globals, init_globals, File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code prepare(preparation_data) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) exec(code, run_globals) File "C:\Users\Downloads\hover_net-master\hover_net-master\run_infer.py", line 74, in _fixup_main_from_path(data['init_main_from_path']) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 287, in fixup_main_from_path import torch main_content = runpy.run_path(main_path, File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 268, in run_path main_content = runpy.run_path(main_path, File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 268, in run_path File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch_init.py", line 129, in main_content = runpy.run_path(main_path, File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 268, in run_path return _run_module_code(code, init_globals, run_name, return _run_module_code(code, init_globals, run_name, File "C:\Users\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path raise err File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 97, in _run_module_code return _run_module_code(code, init_globals, run_name, File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 97, in _run_module_code main_content = runpy.run_path(main_path, OSError: [WinError 1455] The paging file is too small for this operation to complete. Error loading "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\lib\cufft64_10.dll" or one of its dependencies. _run_code(code, mod_globals, init_globals, File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 268, in run_path File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code _run_code(code, mod_globals, init_globals, return _run_module_code(code, init_globals, run_name, exec(code, run_globals) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 97, in run_module_code File "C:\Users\Downloads\hover_net-master\hover_net-master\run_infer.py", line 74, in exec(code, run_globals) File "C:\Users\Downloads\hover_net-master\hover_net-master\run_infer.py", line 74, in run_code(code, mod_globals, init_globals, import torch File "C:\Users\Downloads\hover_net-master\hover_net-master\run_infer.py", line 74, in import torch File "C:\Users\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in run_code File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch_init.py", line 129, in import torch File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch_init.py", line 129, in exec(code, run_globals) File "C:\Users\Downloads\hover_net-master\hover_net-master\run_infer.py", line 74, in File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch_init.py", line 129, in raise err raise err import torch raise err OSError: [WinError 1455] The paging file is too small for this operation to complete. Error loading "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\lib\cufft64_10.dll" or one of its dependencies. OSError: [WinError 1455] The paging file is too small for this operation to complete. Error loading "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\lib\cufft64_10.dll" or one of its dependencies. File "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch_init.py", line 129, in OSError: [WinError 1455] The paging file is too small for this operation to complete. Error loading "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\lib\cudnn_cnn_infer64_8.dll" or one of its dependencies. raise err OSError: [WinError 1455] The paging file is too small for this operation to complete. Error loading "C:\Users\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\lib\cusolver64_11.dll" or one of its dependencies. |2022-12-01|09:45:59.795| [ERROR] Crash Traceback (most recent call last): File "C:\Users\Downloads\hover_net-master\hover_net-master\infer\wsi.py", line 746, in process_wsi_list self.process_single_file(wsi_path, msk_path, self.output_dir) File "C:\Users\Downloads\hover_net-master\hover_net-master\infer\wsi.py", line 689, in process_single_file self.__dispatch_post_processing( File "C:\Users\Downloads\hover_net-master\hover_net-master\infer\wsi.py", line 435, in __dispatch_post_processing assert not silent_crash AssertionError Post Proc Phase 2: 0%| | 0/106 [00:00<?, ?it/s] Traceback (most recent call last): File "C:\Users\Downloads\hover_net-master\hover_net-master\run_infer.py", line 186, in infer.process_wsi_list(run_args) File "C:\Users\Downloads\hover_net-master\hover_net-master\infer\wsi.py", line 750, in process_wsi_list rm_n_mkdir(self.cache_path) # clean up all cache File "C:\Users\Downloads\hover_net-master\hover_net-master\misc\utils.py", line 59, in rm_n_mkdir shutil.rmtree(dir_path) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 740, in rmtree return _rmtree_unsafe(path, onerror) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 618, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "C:\Users\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 616, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'cache\pred_inst.npy'`

mordred-skywalker avatar Dec 01 '22 15:12 mordred-skywalker

Try reducing --nr_post_proc_workers=2 or using --nr_post_proc_workers=0 and see if it helps. We haven't really designed/debugged this with Windows in mind so I'm not sure. Basically above error saying 'cache\pred_inst.npy' is requested to be deleted but it is used by another python process, likely that other process is a dangling parallel worker.

vqdang avatar Dec 02 '22 11:12 vqdang