Error while trying to train model with ConveRT

Hi,

I’m trying to train a model with the pipeline pretrained_embeddings_convert locally from by Ubuntu Bash on Windows 10, but getting this error:

Training model 'convert' failed. Error: libtensorflow_framework.so.2: cannot open shared object file: No such file or directory

I’m using Python 3.6, Rasa 1.6 and TensorFlow 1.15.

Thank you, Tiziano

Hi @tiziano,

Probably something went wrong during installation.

Can you try to reinstall it in a fresh environment? Using Miniconda or pipenv.

See the Quick Installation.

When installing, it could be good to use the --no-cache-dir option:

pip install --no-cache-dir rasa

To avoid interference from previously downloaded, cached stuff that for some reason got corrupted.

Please check the output during installation for any errors. If you something strange, please copy/paste the output to this forum post.

Hi @Arjaan, thank you for your reply.

As you said, I created a new env with pipenv, installed Rasa using the command that you provided.

Below the errors that I got during the installation:

ERROR: sanic-plugins-framework 0.8.2.post1 has requirement sanic<=19.6.3,>=0.8.3, but you'll have sanic 19.9.0 which is incompatible.

rasa-sdk 1.7 requires sanic 19.9.0, but sanic-plugins-framework 0.8.2.post1 (the newest version) requires sanic 19.6.3 or lower. So the only option was to downgrade rasa-sdk (I created a fresh new env and installed rasa 1.6).

Still same error. I found this topic. Now I’m trying solving it.

Ok, I just installed Rasa using the Build Source Installation and this time it worked without errors.

I tried to run the command rasa train nlu -c convert.yml and I got this error:

Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/rasa/__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/usr/local/lib/python3.6/dist-packages/rasa/cli/train.py", line 138, in train_nlu
    persist_nlu_training_data=args.persist_nlu_data,
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 410, in train_nlu
    persist_nlu_training_data,
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 441, in _train_nlu_async
    persist_nlu_training_data=persist_nlu_training_data,
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 470, in _train_nlu_with_validated_data
    persist_nlu_training_data=persist_nlu_training_data,
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/train.py", line 69, in train
    nlu_config = config.load(nlu_config)
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/config.py", line 26, in load
    return _load_from_dict(config, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/config.py", line 46, in _load_from_dict
    return RasaNLUModelConfig(config)
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/config.py", line 97, in __init__
    from rasa.nlu import registry
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/registry.py", line 12, in <module>
    from rasa.nlu.classifiers.embedding_intent_classifier import EmbeddingIntentClassifier
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/classifiers/embedding_intent_classifier.py", line 13, in <module>
    from rasa.utils import train_utils
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/train_utils.py", line 10, in <module>
    from tensor2tensor.models.transformer import (
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/models/__init__.py", line 25, in <module>
    from tensor2tensor.layers import modalities  # pylint: disable=g-import-not-at-top
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/layers/modalities.py", line 28, in <module>
    from tensor2tensor.layers import common_attention
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/layers/common_attention.py", line 954, in <module>
    def attention_bias_to_padding(attention_bias, cast_fn=tf.to_float):
AttributeError: module 'tensorflow' has no attribute 'to_float'

I solved this error in this way, now I got a new error:

Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/rasa/__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/usr/local/lib/python3.6/dist-packages/rasa/cli/train.py", line 138, in train_nlu
    persist_nlu_training_data=args.persist_nlu_data,
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 410, in train_nlu
    persist_nlu_training_data,
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 441, in _train_nlu_async
    persist_nlu_training_data=persist_nlu_training_data,
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 470, in _train_nlu_with_validated_data
    persist_nlu_training_data=persist_nlu_training_data,
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/train.py", line 69, in train
    nlu_config = config.load(nlu_config)
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/config.py", line 26, in load
    return _load_from_dict(config, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/config.py", line 46, in _load_from_dict
    return RasaNLUModelConfig(config)
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/config.py", line 97, in __init__
    from rasa.nlu import registry
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/registry.py", line 12, in <module>
    from rasa.nlu.classifiers.embedding_intent_classifier import EmbeddingIntentClassifier
  File "/usr/local/lib/python3.6/dist-packages/rasa/nlu/classifiers/embedding_intent_classifier.py", line 13, in <module>
    from rasa.utils import train_utils
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/train_utils.py", line 10, in <module>
    from tensor2tensor.models.transformer import (
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/models/__init__.py", line 25, in <module>
    from tensor2tensor.layers import modalities  # pylint: disable=g-import-not-at-top
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/layers/modalities.py", line 32, in <module>
    from tensor2tensor.layers import common_video
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/layers/common_video.py", line 37, in <module>
    tfl = tf.layers
AttributeError: module 'tensorflow' has no attribute 'layers'

Apparently the problem was related to versions of the various components of tensorflow. After many tries I could run it without errors using tensorflow 1.15.0. I finally managed to train the model with conveRT.

Now the only error that I get is this one:

2020-02-05 11:19:07.018146: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)

but doesn’y seem to affect anything.

Thank you!