Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running remora infer #198

Open
johannesnicolaus opened this issue Dec 3, 2024 · 2 comments
Open

Error running remora infer #198

johannesnicolaus opened this issue Dec 3, 2024 · 2 comments

Comments

@johannesnicolaus
Copy link

I tried to run the following command on a bam file called using Dorado v0.83. The pod5 file was converted from fast5 using pod5 convert fast5.

remora \
  infer from_pod5_and_bam \
   converted.pod5 \
   calls.bam \
  --modified-bases m 6ma \
  --model ${modeldir}/res_dna_r10.4.1_e8.2_4khz_400bps_sup_v4.0.1_6mA_v2.pt \
  --out-bam can_infer.bam \
  --log-filename can_infer.log 

I got the following error, which I'm totally unsure what happened.

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/remora/model_util.py", line 593, in load_model
    return load_torchscript_model(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/remora/model_util.py", line 558, in load_torchscript_model
    model, model_metadata = _raw_load_torchscript_model(
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/remora/model_util.py", line 479, in _raw_load_torchscript_model
    model = torch.jit.load(
            ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/torch/jit/_serialization.py", line 163, in load
    cpp_module = torch._C.import_ir_module(cu, os.fspath(f), map_location, _extra_files, _restore_shapes)  # type: ignore[call-arg]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/remora", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/usr/local/lib/python3.11/dist-packages/remora/main.py", line 71, in run
    cmd_func(args)
  File "/usr/local/lib/python3.11/dist-packages/remora/parsers.py", line 1966, in run_infer_from_pod5_and_bam
    models = [
             ^
  File "/usr/local/lib/python3.11/dist-packages/remora/parsers.py", line 1967, in <listcomp>
    load_model(**model_kwargs, quiet=False, eval_only=True)
  File "/usr/local/lib/python3.11/dist-packages/remora/model_util.py", line 597, in load_model
    raise RemoraError("Failed loading torchscript model.")
remora.RemoraError: Failed loading torchscript model.

The following is the command I used to generate the files

dorado basecaller --emit-moves -v hac,5mCG_5hmCG converted.pod5 > calls.bam

I installed remora using pip as shown in the github README.

@marcus1487
Copy link
Collaborator

I'm wondering if this is a torch version issue. What version are you using? Could you try downgrading to torch<2 and report if this solves the issue?

@marcus1487
Copy link
Collaborator

Googling seems to indicate a corrupted file. Can you also try to download the model again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants