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.

ImportError: cannot import name 'create_features'

See original GitHub issue

Rasa version: 0.14.1

Rasa X version (if used & relevant):

Python version: 3.6

Operating system (windows, osx, …): ubuntu 16.04

Issue: create_features not found in bert extract_features.py

Error (including full traceback):

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/gpu21080ti/tensorflow1.3.3.5/tensorcode/rasa/rasa_nlu/train.py", line 184, in <module>
    num_threads=cmdline_args.num_threads)
  File "/home/gpu21080ti/tensorflow1.3.3.5/tensorcode/rasa/rasa_nlu/train.py", line 148, in do_train
    trainer = Trainer(cfg, component_builder)
  File "/home/gpu21080ti/tensorflow1.3.3.5/tensorcode/rasa/rasa_nlu/model.py", line 152, in __init__
    components.validate_requirements(cfg.component_names)
  File "/home/gpu21080ti/tensorflow1.3.3.5/tensorcode/rasa/rasa_nlu/components.py", line 49, in validate_requirements
    from rasa_nlu import registry
  File "/home/gpu21080ti/tensorflow1.3.3.5/tensorcode/rasa/rasa_nlu/registry.py", line 36, in <module>
    from rasa_nlu.featurizers.bert_featurizer import BertFeaturizer
  File "/home/gpu21080ti/tensorflow1.3.3.5/tensorcode/rasa/rasa_nlu/featurizers/bert_featurizer.py", line 15, in <module>
    from bert.extract_features import create_features, model_fn_builder
ImportError: cannot import name 'create_features'

Command or request that led to error:

 python -m rasa_nlu.train -c sample_configs/config_bert.yml --data testData.json

Content of configuration file (config.yml) (if relevant):

language: "en"

pipeline:
- name: "intent_featurizer_bert"
  model_dir: "./uncased_L-12_H-768_A-12"
- name: "intent_classifier_sklearn"

Content of domain file (domain.yml) (if relevant):


Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Ghostvvcommented, Jul 24, 2019

you should use this fork: https://github.com/RasaHQ/bert

0reactions
DavidForlencommented, Aug 1, 2019

Thanks a lot ! It runs correctly now (even if it takes time on CPUs, I will try on GPUs).

But I couldn’t install the bert package from this branch neatly. How should I install it without having to take the bert directory from the branch and putting it directly in my working directory ? I tried docker-compose exec medibot pip install git+https://github.com/RasaHQ/bert, and pip tells me Successfully built bert. But then rerunning the training shows me : ModuleNotFoundError: No module named 'bert'.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: cannot import name <...> (most likely due to a ...
The core of the issue is that I have to import classes A and B in both c.py and d.py file but I...
Read more >
How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >
ImportError: cannot import name 'Raster' from 'arcgis.raster'
Hello,. I am using arcgis 1.7.1 module in my local Python 3.7 environment. On the following statement: from arcgis.raster import Raster.
Read more >
How to Fix : “ImportError: Cannot import name X” in Python?
You can solve the “ ImportError : Cannot import name X” Error by resolving the circular dependencies. You can do that either by...
Read more >
ImportError: cannot import name 'Feature' from 'setuptools' #120
ERROR : Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
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