bonito icon indicating copy to clipboard operation
bonito copied to clipboard

bonito export

Open fergsc opened this issue 1 year ago • 5 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 avatar Jun 07 '23 01:06 fergsc

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

iiSeymour avatar Jun 07 '23 08:06 iiSeymour

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

fergsc avatar Jun 07 '23 08:06 fergsc

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 https://github.com/nanoporetech/bonito/issues/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.

fergsc avatar Jun 07 '23 08:06 fergsc

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

Thanks!

dnawhisperer avatar Jun 19 '23 02:06 dnawhisperer

The export function input is required to be a directory.

jorisbalc avatar Jun 25 '23 22:06 jorisbalc