taiyaki icon indicating copy to clipboard operation
taiyaki copied to clipboard

Issue running prepare_mapped_reads.py

Open SanglierA opened this issue 4 years ago • 4 comments

Hello, I'm kind of new to nanopore technology and wanted to to try taiyaki on algae sequences. Yet I have a problem when I'm running prepare_mapped_reads. First there are many warnings while running and after that I have an error on the version of my checkpoint model. Yet I got the pretrained model from the taiyaki_walkthrough folder.

Error :

File "/home/sangliera/taiyaki-env/bin/prepare_mapped_reads.py", line 141, in <module>
    main()
  File "/home/sangliera/taiyaki-env/bin/prepare_mapped_reads.py", line 108, in main
    kwargs['model'] = helpers.load_model(args.model)
  File "/home/sangliera/taiyaki-env/lib/python3.8/site-packages/taiyaki/helpers.py", line 106, in load_model
    assert hasattr(network, 'metadata'), \
AssertionError: Attempted to load unversioned model checkpoint.

I tried to run the misc/upgrade_model.py with the model but it didn't really help.

Thanks a lot in advance for your time.

SanglierA avatar Mar 03 '21 14:03 SanglierA

You say that "misc/upgrade_model.py" didn't really help. In what way? Did "upgrade_model.py" succeed or give errors? If the upgrade succeeded, presumably you got a different error when you tried to use it after the upgrade, what was it? If the upgrade failed, presumably that gave an error of some sort so you need to provide details.

SCDealy avatar Mar 06 '21 22:03 SCDealy

Hello @SCDealy, I am having a similar problem... When running prepare_mapped_reads I got several warnings stating "SourceChangeWarning" for the following source codes: "taiyaki.layers.Serial", "torch.nn.modules.container.ModuleList", "taiyaki.layers.Convolution", "torch.nn.modules.padding.ConstantPad1d", "torch.nn.modules.conv.Conv1d", "taiyaki.layers.Reverse", "taiyaki.layers.GruMod", "torch.nn.modules.rnn.GRU", "taiyaki.layers.GlobalNormFlipFlop", and "torch.nn.modules.linear.Linear".

Also, I got a similar error as the individual above, my example is below.

Traceback (most recent call last): File "/work2/08286/nrp_lab/maverick2/apps/taiyaki/venv/bin/prepare_mapped_reads. py", line 7, in exec(compile(f.read(), file, 'exec')) File "/work2/08286/nrp_lab/maverick2/apps/taiyaki/bin/prepare_mapped_reads.py", line 141, in main() File "/work2/08286/nrp_lab/maverick2/apps/taiyaki/bin/prepare_mapped_reads.py", line 108, in main kwargs['model'] = helpers.load_model(args.model) File "/work2/08286/nrp_lab/maverick2/apps/taiyaki/taiyaki/helpers.py", line 109, in load_model """ AssertionError: Attempted to load unversioned model checkpoint. Please run misc/upgrade_model.py

Then when I try to run the command upgrade_model.py I get the message that the command cannot be found. I also tried misc/upgrade_model.py and got the message "No such file or directory" am I missing something?

Thank you in advance for your time and help.

dmr0263 avatar Dec 03 '21 17:12 dmr0263

Based on your traceback, it appears to me that the full path to "upgrade_model.py" on your system should be:

/work2/08286/nrp_lab/maverick2/apps/taiyaki/misc/upgrade_model.py

presumably your working directory is not inside the installed Taiyaki directory tree and the .../taiyaki/misc directory is probably not on your path, so you probably need to provide either the full path above to run the command, or a path that is specified relative to your working directory. The "locate" command can be useful for finding these kinds of accessory programs that are often provided with software packages but not installed on the default paths for executable programs

SCDealy avatar Dec 03 '21 19:12 SCDealy

@SCDealy Thank you for your help and prompt response. Another question for you... When executing the upgrade_model.py script, the input file needed that is described as the "mapped signal to read from", would that be the previously generated tsv file from the generate_per_read_params.py script? Thank you again in advance for your time and help.

dmr0263 avatar Dec 09 '21 20:12 dmr0263