koenvervloesem / rasa-docker-arm

Rasa Docker image for ARMv7. Runs on a Raspberry Pi.
https://hub.docker.com/r/koenvervloesem/rasa
MIT License
19 stars 2 forks source link

Error training model #6

Closed d-v closed 2 years ago

d-v commented 2 years ago

Hello! Fantastic project I am noob with Rasa and docker in general but I am running into some issues with RPi 4b 8gb, 128gb sd. When launching for the first time it says I need to train a model

pi@raspberrypi:~/rasa-docker-arm $ docker-compose up
Pulling rasa (koenvervloesem/rasa:1.10.5)...
1.10.5: Pulling from koenvervloesem/rasa
2dd003996c9a: Pull complete
62c3c9ab7282: Pull complete
87cb09faa57a: Pull complete
1f63528d297b: Pull complete
e107ba5cf06f: Pull complete
cd50f30740b6: Pull complete
47a625478f00: Pull complete
983276e7cc1c: Pull complete
c08b4985c4e2: Pull complete
f96532f5bf00: Pull complete
Digest: sha256:d2c39739ef05a53c8f4755d118b208eb45beaacb0f6c7fda22332ae589fef2ae
Status: Downloaded newer image for koenvervloesem/rasa:1.10.5
Creating rasa-docker-arm_rasa_1 ... done
Attaching to rasa-docker-arm_rasa_1
rasa_1  | No model found. You have three options to provide a model:
rasa_1  | 1. Configure a model server in the endpoint configuration and provide the configuration via '--endpoints'.
rasa_1  | 2. Specify a remote storage via '--remote-storage' to load the model from.
rasa_1  | 3. Train a model before running the server using `rasa train` and use '--model' to provide the model path.
rasa_1  | For more information check https://rasa.com/docs/rasa/user-guide/configuring-http-api/.
rasa-docker-arm_rasa_1 exited with code 0

However when I train a model it gives an error

pi@raspberrypi:~/rasa-docker-arm $ docker run  --user $(id -u):$(id -g) -it -v $(pwd):/app --entrypoint rasa koenvervloesem/rasa init
WARNING: The requested image's platform (linux/arm) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Welcome to Rasa! 🤖

To get started quickly, an initial project will be created.
If you need some help, check out the documentation at https://rasa.com/docs/rasa.
Now let's start! 👇🏽

? Please enter a path where the project will be created [default: current directory] .
? Directory '/app' is not empty. Continue?  Yes
Created project directory at '/app'.
Finished creating project structure.
? Do you want to train an initial model? 💪🏽  Yes
Training an initial model...
Training Core model...
Traceback (most recent call last):
  File "/opt/venv/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/opt/venv/lib/python3.7/site-packages/rasa/__main__.py", line 92, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/opt/venv/lib/python3.7/site-packages/rasa/cli/scaffold.py", line 206, in run
    init_project(args, path)
  File "/opt/venv/lib/python3.7/site-packages/rasa/cli/scaffold.py", line 118, in init_project
    print_train_or_instructions(args, path)
  File "/opt/venv/lib/python3.7/site-packages/rasa/cli/scaffold.py", line 58, in print_train_or_instructions
    args.model = rasa.train(domain, config, training_files, output)
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 50, in train
    additional_arguments=additional_arguments,
  File "uvloop/loop.pyx", line 1494, in uvloop.loop.Loop.run_until_complete
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 101, in train_async
    additional_arguments,
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 188, in _train_async_internal
    additional_arguments=additional_arguments,
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 223, in _do_training
    additional_arguments=additional_arguments,
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 361, in _train_core_with_validated_data
    additional_arguments=additional_arguments,
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/train.py", line 43, in train
    policies = config.load(policy_config)
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/config.py", line 28, in load
    return PolicyEnsemble.from_dict(config_data)
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/policies/ensemble.py", line 308, in from_dict
    constr_func = registry.policy_from_module_path(policy_name)
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/registry.py", line 21, in policy_from_module_path
    module_path, lookup_path="rasa.core.policies.registry"
  File "/opt/venv/lib/python3.7/site-packages/rasa/utils/common.py", line 244, in class_from_module_path
    m = importlib.import_module(lookup_path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/policies/registry.py", line 5, in <module>
    from rasa.core.policies.ted_policy import TEDPolicy
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/policies/ted_policy.py", line 8, in <module>
    import tensorflow_addons as tfa
  File "/opt/venv/lib/python3.7/site-packages/tensorflow_addons/__init__.py", line 30, in <module>
    from tensorflow_addons import text
  File "/opt/venv/lib/python3.7/site-packages/tensorflow_addons/text/__init__.py", line 43, in <module>
    from tensorflow_addons.text.parse_time_op import parse_time
  File "/opt/venv/lib/python3.7/site-packages/tensorflow_addons/text/parse_time_op.py", line 25, in <module>
    get_path_to_datafile("custom_ops/text/_parse_time_op.so"))
  File "/opt/venv/lib/python3.7/site-packages/tensorflow_core/python/framework/load_library.py", line 57, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: /opt/venv/lib/python3.7/site-packages/tensorflow_addons/custom_ops/text/_parse_time_op.so: undefined symbol: _ZN4absl9ParseTimeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_PNS_4TimeEPS5_

Also I did not have any luck building the image so thank you for providing one to download!

d-v commented 2 years ago

I was using wrong syntax but it is still giving error with right init syntax

pi@raspberrypi:~/rasa-docker-arm $ docker-compose up
Recreating rasa-docker-arm_rasa_1 ... done
Attaching to rasa-docker-arm_rasa_1
rasa_1  | No model found. You have three options to provide a model:
rasa_1  | 1. Configure a model server in the endpoint configuration and provide the configuration via '--endpoints'.
rasa_1  | 2. Specify a remote storage via '--remote-storage' to load the model from.
rasa_1  | 3. Train a model before running the server using `rasa train` and use '--model' to provide the model path.
rasa_1  | For more information check https://rasa.com/docs/rasa/user-guide/configuring-http-api/.
rasa-docker-arm_rasa_1 exited with code 0
pi@raspberrypi:~/rasa-docker-arm $ docker-compose up -d
Starting rasa-docker-arm_rasa_1 ... done
pi@raspberrypi:~/rasa-docker-arm $ docker-compose run rasa init
Creating rasa-docker-arm_rasa_run ... done
Welcome to Rasa! 🤖

To get started quickly, an initial project will be created.
If you need some help, check out the documentation at https://rasa.com/docs/rasa.
Now let's start! 👇🏽

? Please enter a path where the project will be created [default: current directory] .
? Directory '/app' is not empty. Continue?  Yes
Created project directory at '/app'.
Finished creating project structure.
? Do you want to train an initial model? 💪🏽  Yes
Training an initial model...
Training Core model...
Traceback (most recent call last):
  File "/opt/venv/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/opt/venv/lib/python3.7/site-packages/rasa/__main__.py", line 92, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/opt/venv/lib/python3.7/site-packages/rasa/cli/scaffold.py", line 206, in run
    init_project(args, path)
  File "/opt/venv/lib/python3.7/site-packages/rasa/cli/scaffold.py", line 118, in init_project
    print_train_or_instructions(args, path)
  File "/opt/venv/lib/python3.7/site-packages/rasa/cli/scaffold.py", line 58, in print_train_or_instructions
    args.model = rasa.train(domain, config, training_files, output)
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 50, in train
    additional_arguments=additional_arguments,
  File "uvloop/loop.pyx", line 1494, in uvloop.loop.Loop.run_until_complete
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 101, in train_async
    additional_arguments,
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 188, in _train_async_internal
    additional_arguments=additional_arguments,
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 223, in _do_training
    additional_arguments=additional_arguments,
  File "/opt/venv/lib/python3.7/site-packages/rasa/train.py", line 361, in _train_core_with_validated_data
    additional_arguments=additional_arguments,
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/train.py", line 43, in train
    policies = config.load(policy_config)
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/config.py", line 28, in load
    return PolicyEnsemble.from_dict(config_data)
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/policies/ensemble.py", line 308, in from_dict
    constr_func = registry.policy_from_module_path(policy_name)
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/registry.py", line 21, in policy_from_module_path
    module_path, lookup_path="rasa.core.policies.registry"
  File "/opt/venv/lib/python3.7/site-packages/rasa/utils/common.py", line 244, in class_from_module_path
    m = importlib.import_module(lookup_path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/policies/registry.py", line 5, in <module>
    from rasa.core.policies.ted_policy import TEDPolicy
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/policies/ted_policy.py", line 8, in <module>
    import tensorflow_addons as tfa
  File "/opt/venv/lib/python3.7/site-packages/tensorflow_addons/__init__.py", line 30, in <module>
    from tensorflow_addons import text
  File "/opt/venv/lib/python3.7/site-packages/tensorflow_addons/text/__init__.py", line 43, in <module>
    from tensorflow_addons.text.parse_time_op import parse_time
  File "/opt/venv/lib/python3.7/site-packages/tensorflow_addons/text/parse_time_op.py", line 25, in <module>
    get_path_to_datafile("custom_ops/text/_parse_time_op.so"))
  File "/opt/venv/lib/python3.7/site-packages/tensorflow_core/python/framework/load_library.py", line 57, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: /opt/venv/lib/python3.7/site-packages/tensorflow_addons/custom_ops/text/_parse_time_op.so: undefined symbol: _ZN4absl9ParseTimeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_PNS_4TimeEPS5_
ERROR: 1
pi@raspberrypi:~/rasa-docker-arm $
koenvervloesem commented 2 years ago

I see that you've closed this issue, were you able to solve it? What operating system version are you running? 64-bit of 32-bit?

d-v commented 2 years ago

Hello, I closed the issue because I noticed the reason for the issue which was Raspbian 64 bit 11 bullseye. Closed it to install 32 bit debian 10. However still getting an error during build on newly installed debian 10 https://gist.github.com/d-v/1de15fbcd55c7b1b51862d4019c4ca53 I was successfully able to run the docker image on 32 bit debian 10, train the model and talk to the bot on the command line! Is there a way to include rasa x in a built image? I would like to run a rasa server on my pi and expose it through ngrok so that my classmates can try the bot. Currently that works on my pc but it would be so much cooler running on a pi 8)

pi@raspberrypi:~/rasa-docker-arm $ docker-compose run rasa x
Creating rasa-docker-arm_rasa_run ... done
Traceback (most recent call last):
  File "/opt/venv/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/opt/venv/lib/python3.7/site-packages/rasa/__main__.py", line 92, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/opt/venv/lib/python3.7/site-packages/rasa/cli/x.py", line 326, in rasa_x
    run_locally(args)
  File "/opt/venv/lib/python3.7/site-packages/rasa/cli/x.py", line 414, in run_locally
    from rasax.community import local  # pytype: disable=import-error
ModuleNotFoundError: No module named 'rasax'
ERROR: 1
pi@raspberrypi:~/rasa-docker-arm $
d-v commented 2 years ago

Also thank you so much for the quick reply! I apologize about the delay replying

koenvervloesem commented 2 years ago

Sorry, I've never tried Rasa X myself, so I have no idea whether it would run on the Raspberry Pi or even in the same Docker image.

d-v commented 2 years ago

No worries, thank you for the great repo! Hopefully I can figure this out...