kishwarshafin/helen

torch.set_num_threads error in docker image

jmkidd opened this issue · 3 comments

Hi, am trying to run the docker image and get a torch runtime error.
Is this an error in the docker image? Thanks!

INFO: POLISH MODULE SELECTED
INFO: RUN-ID: 09012020_134236
INFO: PREDICTION OUTPUT DIRECTORY: /.../helen_out/predictions_09012020_134236
INFO: CALL CONSENSUS STARTING
INFO: OUTPUT FILE: /.../helen_out/predictions_09012020_134236/265L12.cont.cor.fa
INFO: MODEL LOADING TO ONNX
Traceback (most recent call last):
File "/opt/conda/bin/helen", line 8, in
sys.exit(main())
File "/opt/conda/lib/python3.7/site-packages/helen/helen.py", line 313, in main
FLAGS.callers)
File "/opt/conda/lib/python3.7/site-packages/helen/modules/python/PolishInterface.py", line 87, in polish_genome
callers)
File "/opt/conda/lib/python3.7/site-packages/helen/modules/python/CallConsensusInterface.py", line 153, in call_consensus
callers, threads_per_caller, num_workers)
File "/opt/conda/lib/python3.7/site-packages/helen/modules/python/models/predict_cpu.py", line 248, in predict_cpu
join=True)
File "/opt/conda/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 171, in spawn
while not spawn_context.join():
File "/opt/conda/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 118, in join
raise Exception(msg)
Exception:

-- Process 0 terminated with the following error:
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/torch/multiprocessing/spawn.py", line 19, in _wrap
fn(i, *args)
File "/opt/conda/lib/python3.7/site-packages/helen/modules/python/models/predict_cpu.py", line 194, in setup
threads)
File "/opt/conda/lib/python3.7/site-packages/helen/modules/python/models/predict_cpu.py", line 65, in predict
torch.set_num_threads(threads)
RuntimeError: set_num_threads expects a positive integer

Hi @jmkidd ,

Sorry for being late on this. Can you please post the full command here? This is an unusual error. are you using --ipc=host ?

Thanks for looking into this. Here is the command.

singularity exec helen_latest.sif helen polish
--image_dir marginpolish_images/
--model_path mp_helen_models/HELEN_r103_guppy_microbial.pkl
--batch_size 5
--num_workers 2
--threads 2
--output_dir helen_out/
--output_prefix 265L12.cont.cor.fa

Hi @jmkidd ,

I have been trying to re-create the issue internally but I don't think I can. Any chance you can find a suitable place to run the docker without sigularity and see if the error sustains?