nanoporetech / bonito

A PyTorch Basecaller for Oxford Nanopore Reads

Home Page:https://nanoporetech.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bonito export

fergsc opened this issue · comments

Hi,
I have used bonito to train a model and have exported it for use in guppy. For my model cfg file I have modified dna_r10.4.1_e8.2_400bps_sup.cfg, pointing it to my jsn file. Is this the correctcfg file to use?

bonito export --format guppy --config basecalls/config.toml basecalls/weights_20.tar > myModel.jsn

When I try to use my model in guppy I get this error [guppy/error] main: Layer type 'GlobalNormTransducer' must not be last layer.

Bonito version = 0.7.0
Guppy = 6.4.6

Thanks.

@fergsc is this model a custom design of your own?

It was producded from bonito with 3 data subsets, 2 using --pretrained

If I try to export as dorado bonito export --format dorado --config basecalls/config.toml basecalls/weights_20.tar > dorado.jsn

I get this error

Traceback (most recent call last): File "/bonito-0.7.0/venv3/bin/bonito", line 11, in <module> load_entry_point('ont-bonito==0.7.0', 'console_scripts', 'bonito')() File "/bonito-0.7.0/venv3/lib/python3.8/site-packages/bonito/__init__.py", line 34, in main args.func(args) File "/bonito-0.7.0/venv3/lib/python3.8/site-packages/bonito/cli/export.py", line 163, in main save_tensor(args.model, name, tensor) File "/bonito-0.7.0/venv3/lib/python3.8/site-packages/bonito/cli/export.py", line 62, in save_tensor tensors.save(f"{directory}/{name}.tensor") File "/bonito-0.7.0/venv3/lib/python3.8/site-packages/torch/jit/_script.py", line 713, in save return self._c.save(str(f), **kwargs) RuntimeError: Parent directory basecalls/weights_20.tar does not exist.

Is the export function broken #331 ?

I also tried exporting the bonito 0.7.0 trained model using an older bonito version (0.5.3), however it looks like the file format has changed and models are no longer compatible.

Hi @iiSeymour I have the same issue. Export function doesnt seem to work anymore.

Thanks!

The export function input is required to be a directory.