pinellolab/dictys

issue while running network inference step

Closed this issue · 3 comments

Hello,

I am trying to run the short-multiome tutorial and encountered an error.

I created a conda environment (cpu version) with the instructions provided and initial steps ran fine.
The issue occurred at step 10 in the jupyter notebook - !cd ..; dictys_helper network_inference.sh -j 32 -J 1 static

I am running this on our cluster by directly executing the jupyter notebook using this command -
bsub -W 12:00 -M 128000 -n 8 -o dictys_try.out -e dictys_try.err -J dictys_try jupyter nbconvert --to notebook --allow-errors --ExecutePreprocessor.timeout=-1 --execute run.ipynb

the error log file generated from the above command is in this link - log file

Would appreciate any help debugging this issue.

--
Regards,
Sid

Hi Sid,

This is the error:

python3 -m dictys  network reconstruct --device cuda:0 --nth 4 tmp_static/Subset9/expression.tsv.gz tmp_static/Subset9/binlinking.tsv.gz tmp_static/Subset9/net_weight.tsv.gz tmp_static/Subset9/net_meanvar.tsv.gz tmp_static/Subset9/net_covfactor.tsv.gz tmp_static/Subset9/net_loss.tsv.gz tmp_static/Subset9/net_stats.tsv.gz
Traceback (most recent call last):
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/site-packages/dictys/__main__.py", line 13, in <module>
    docstringrunner(__package__)
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/site-packages/docstring2argparse/__init__.py", line 340, in docstringrunner
    run_args(pkgname,funcs,args)
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/site-packages/docstring2argparse/__init__.py", line 330, in run_args
    return func(*a,**ka)
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/site-packages/dictys/network.py", line 787, in reconstruct
    model=model('pyromodel',np.array(np.nonzero(mask)),mask.shape,npc,dc,floattype=dtype,device=device,scale_lyapunov=scale_lyapunov)
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/site-packages/dictys/network.py", line 626, in __init__
    super().__init__(name,npc,dcs,**ka)
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/site-packages/dictys/network.py", line 499, in __init__
    self.dcs=self.tensor(dcs.T)
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/site-packages/dictys/network.py", line 211, in tensor
    return torch.tensor(v,device=device,dtype=dtype,**ka)
  File "/data/salomonis2/LabFiles/Sid/dictys_self_env/dictys_self_env/lib/python3.9/site-packages/torch/cuda/__init__.py", line 211, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

This means you are trying to use GPU although you installed pytorch without GPU support.

In the notebook, you see these lines:

%%bash
# Generate configuration template
rm -Rf ../makefiles
mkdir ../makefiles
cd ../makefiles
dictys_helper makefile_template.sh common.mk config.mk env_none.mk static.mk

# Update configurations, such as:
# DEVICE: pytorch device, e.g. cpu, cuda:0. If you do not have a GPU, use 'cpu' and expect LONG computing time.
# GENOME_MACS2: effective genome size for macs2. See https://deeptools.readthedocs.io/en/develop/content/feature/effectiveGenomeSize.html
# JOINT: whether dataset is joint profiling of RNA and ATAC.
# Other configurations include quality control thresholds, number of threads in each job, number of hidden confounders, etc.
# They can be obtained in the full-multiome tutorial.
dictys_helper makefile_update.py ../makefiles/config.mk '{"DEVICE": "cuda:0", "GENOME_MACS2": "hs", "JOINT": "1"}'

As documented above, to use CPU, you need to replace "cuda:0" with "cpu" in the bottom line.

After this correction, you can save time by continuing from the last run with just dictys_helper network_inference.sh -j 32 -J 1 static in bash under the short-multiome folder.

To be clear, you still need to run this line to update the configuration: dictys_helper makefile_update.py ../makefiles/config.mk '{"DEVICE": "cpu", "GENOME_MACS2": "hs", "JOINT": "1"}'

Stale issue message