nanoporetech / remora

Methylation/modified base calling separated from basecalling.
https://nanoporetech.com
Other
156 stars 20 forks source link

Remora model train error #36

Closed GianlucaMattei closed 2 years ago

GianlucaMattei commented 2 years ago

Hello, I am trying to use remora with megalodon, anyway when I run the "model train" command I get this error:

remora   model train   /data/Nanopore//Remora/remora_train_chunks.npz   --model /data/Tools/lib/taiyaki/models/ConvLSTM_w_ref.py   --size 96   --epochs 100   --early-stopping 10   --scheduler StepLR   --lr-sched-kwargs step_size 10 int   --lr-sched-kwargs gamma 0.5 float   --output-path /data/Nanopore/Remora/Results/remora_train_results

[04:34:54] Seed selected is 599182259
[04:34:54] Loading dataset from Remora file
[04:34:54] Dataset loaded with labels: Counter({1: 130143, 0: 64236})
[04:34:54] Dataset summary:
               num chunks : 194379
       label distribution : Counter({1: 130143, 0: 64236})
                base_pred : False
                mod_bases : m
           mod_long_names : ('5mC',)
       kmer_context_bases : (4, 4)
            chunk_context : (50, 50)
                   motifs : [('CG', 0)]
 chunk_extract_base_start : False
     chunk_extract_offset : 0
          sig_map_refiner : Loaded 0-mer table with 0 central position.

[04:34:54] Loading model
Traceback (most recent call last):
  File "/home/usr/.conda/envs/remora/bin/remora", line 8, in <module>
    sys.exit(run())
  File "/home/usr/.conda/envs/remora/lib/python3.7/site-packages/remora/main.py", line 69, in run
    cmd_func(args)
  File "/home/usr/.conda/envs/remora/lib/python3.7/site-packages/remora/parsers.py", line 604, in run_model_train
    args.balanced_batch,
  File "/home/usr/.conda/envs/remora/lib/python3.7/site-packages/remora/train_model.py", line 154, in train_model
    model = model_util._load_python_model(copy_model_path, **model_params)
  File "/home/usr/.conda/envs/remora/lib/python3.7/site-packages/remora/model_util.py", line 200, in _load_python_model
    loader.exec_module(netmodule)
  File "<frozen importlib._bootstrap_external>", line 724, in exec_module
  File "<frozen importlib._bootstrap_external>", line 860, in get_code
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/data/Nanopore/Remora/Results/remora_train_results/model.py", line 8
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

I followed the instructions for installation and everything went well, I was able to run the previous commands of the tutorial in the github.

budnikm commented 2 years ago

Hi, Could you show what /data/Nanopore/Remora/Results/remora_train_results/model.py looks like? In your case, it should be exactly the same as https://github.com/nanoporetech/remora/tree/master/models/ConvLSTM_w_ref.py

GianlucaMattei commented 2 years ago

Hi, it definitely looks like an HTML file. The same for ConvLSTM_w_ref.py. From what I saw basically it downloaded the html page instead the script. Can I just replace them with the code in the link you sent me?

budnikm commented 2 years ago

Yeah, try that. If everything else is okay then it should work.

GianlucaMattei commented 2 years ago

It seems to work, it finished the first epoch. I am closing the issue once it will finish with no errors.

Thanks

EDIT: Anyway it seems an error related to taiyaki.