question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: persist() missing 1 required positional argument: 'model_dir'

See original GitHub issue

Rasa NLU version: 0.14.4

Operating system: OS X

Content of model configuration file:

language: "zh"

pipeline:
    - name: "nlp_mitie"
      model: "data/total_word_feature_extractor_zh.dat"
    - name: "tokenizer_jieba_search.JiebaTokenizer"
      dictionary_path: "data/jieba_dict.txt"
    - name: "ner_mitie"
    - name: "ner_synonyms"
    - name: "intent_entity_featurizer_regex"
    - name: "intent_featurizer_mitie"
    - name: "intent_classifier_sklearn"

Issue: I substituted tokenizer_jieba with the customized one which is I copied from here (https://raw.githubusercontent.com/RasaHQ/rasa_nlu/fff482663cd33ec16b16a39847e58884f4b4c9a2/rasa_nlu/tokenizers/jieba_tokenizer.py) without chaning anything, and renamed it to tokenizer_jieba_search.py.

It gives error log below:

Traceback (most recent call last):
  File "/Users/kai/.pyenv/versions/3.6.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/kai/.pyenv/versions/3.6.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/kai/.virtualenvs/rasa-play-re5z2bZX/lib/python3.6/site-packages/rasa_nlu/train.py", line 184, in <module>
    num_threads=cmdline_args.num_threads)
  File "/Users/kai/.virtualenvs/rasa-play-re5z2bZX/lib/python3.6/site-packages/rasa_nlu/train.py", line 160, in do_train
    fixed_model_name)
  File "/Users/kai/.virtualenvs/rasa-play-re5z2bZX/lib/python3.6/site-packages/rasa_nlu/model.py", line 233, in persist
    update = component.persist(dir_name)
TypeError: persist() missing 1 required positional argument: 'model_dir'

If I use tokenizer_jieba, it would works fine.

Since I didn’t change the tokenizer code (except its file name), I thought it will works. Was I missed something?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
akeladcommented, Mar 27, 2019

@erohmensing can you take a look instead?

0reactions
erohmensingcommented, Mar 31, 2019

@kaiwk I’m glad it works! If you create a PR, we’ll check it out. What sorts of different tokenizer modes does it support?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: save() missing 1 required positional argument: 'self'
I want to save user_profile to mysql,But user_profile.save() has an error, TypeError: save() missing 1 required positional argument: ...
Read more >
TypeError: persist() missing 1 required positional argument ...
@kaiwk It looks like the code you copied is out of date with changes that went into 0.14.4 -- you'll notice here that...
Read more >
TypeError: missing 1 required positional argument: 'self'
The Python "TypeError: missing 1 required positional argument: 'self'" occurs when we call a method on the class instead of on an instance...
Read more >
nvidia Jetson 2GB training fails - TypeError: __init__() missing ...
After training for 10 hours in epoch 1, it fails. I am stuck. ... TypeError: init() missing 1 required positional argument: 'dtype'.
Read more >
TypeError: create() missing 1 required positional argument: 'vals'
when the change the state or give save, odoo popping me an error as below ... **kwargs) TypeError: create() missing 1 required positional...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found