# Rasa train (rasa 1.9.x | TensorFlow 2) on GPU?

**URL:** <https://forum.rasa.com/t/rasa-train-rasa-1-9-x-tensorflow-2-on-gpu/27299>\
**Category:** Rasa Open Source\
**Created:** [April 9, 2020, 9:55pm UTC](https://forum.rasa.com/t/rasa-train-rasa-1-9-x-tensorflow-2-on-gpu/27299 "2020-04-09T21:55:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amvas](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@amvas](https://forum.rasa.com/u/amvas)\
**Post date:** [April 9, 2020, 9:55pm UTC](https://forum.rasa.com/t/rasa-train-rasa-1-9-x-tensorflow-2-on-gpu/27299/1 "2020-04-09T21:55:43Z")

</div>

_Version: dev-CC_ Hi all, Is there anyone successfully trained a bot/model using Rasa 1.9.X on GPU? I was using Rasa 1.7 with gpu and training was fast and straight forward. But we recently switched to Rasa 1.9 to be able using DIET classifier improving entity extraction.

From performance (accuracy) aspect, DIET classifier is great but quite slow and always running on CPUs. We did a deep dive in the codes and there was/is nothing preventing DIET from GPU, even it seems it tries to load data on GPU but no processing at all and then switches back to CPUs!

**Does anyone experiencing same situation, and have you find any solution?**

We did some hacks and got the following error:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/c/cded69bebcdc5051211baf854980eededeb0d13f.png)

I searched for this error, and it looks kind of TensorFlow 2.1 bug (I am not 100% sure that this TF bug is the source our problem but somehow explains weird behavior of our GPUs).

Meanwhile, we have setup and tested the environment variables for gpu run: TF\_FORCE\_GPU\_ALLOW\_GROWTH=True

tf.config.experimental.list\_physical\_devices(‘GPU’)

tf.config.set\_visible\_devices(, ‘GPU’)

Versions: Rasa 1.9.5 , TensorFlow 2.1.0 , Ubuntu: 16.04.6 LTS , CUDA: 10.1

---

<div class="post-metadata">

**Author:** ![koaning](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/koaning/32/6626_2.png) [@koaning](https://forum.rasa.com/u/koaning)\
**Post date:** [April 11, 2020, 6:09am UTC](https://forum.rasa.com/t/rasa-train-rasa-1-9-x-tensorflow-2-on-gpu/27299/2 "2020-04-11T06:09:00Z")

</div>

It seems to be a CUDA issue. Can you run normal tensorflow/keras code with CUDA?

---

<div class="post-metadata">

**Author:** ![amvas](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@amvas](https://forum.rasa.com/u/amvas)\
**Post date:** [April 11, 2020, 2:18pm UTC](https://forum.rasa.com/t/rasa-train-rasa-1-9-x-tensorflow-2-on-gpu/27299/3 "2020-04-11T14:18:31Z")

</div>

@koaning, yes I can run simple tensorflow code with no problem.

---

<div class="post-metadata">

**Author:** ![koaning](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/koaning/32/6626_2.png) [@koaning](https://forum.rasa.com/u/koaning)\
**Post date:** [April 14, 2020, 1:06pm UTC](https://forum.rasa.com/t/rasa-train-rasa-1-9-x-tensorflow-2-on-gpu/27299/4 "2020-04-14T13:06:55Z")

</div>

But are these tensorflow programs using tensorflow? Putting the error into google suggests this result; [tensorflow2.0 - Could not load dynamic library 'cudart64\_101.dll' on tensorflow CPU-only installation - Stack Overflow](https://stackoverflow.com/questions/59823283/could-not-load-dynamic-library-cudart64-101-dll-on-tensorflow-cpu-only-install).

---

<div class="post-metadata">

**Author:** ![tahamr83](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tahamr83/32/8114_2.png) [@tahamr83](https://forum.rasa.com/u/tahamr83)\
**Post date:** [June 17, 2020, 9:53pm UTC](https://forum.rasa.com/t/rasa-train-rasa-1-9-x-tensorflow-2-on-gpu/27299/5 "2020-06-17T21:53:19Z")

</div>

@amvas I have almost no exposure to tensorflow and cuda. Can you perhaps guide me a little bit on how to run the NLU and core both on GPU. Also did you see any performance gains. We are working on some latency critical app and need to optimize the latency as much as possible. So did it improve the overall response time on GPU?

---

<div class="post-metadata">

**Author:** ![PaoloRossi79](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/paolorossi79/32/11887_2.png) [@PaoloRossi79](https://forum.rasa.com/u/PaoloRossi79)\
**Post date:** [November 20, 2020, 4:13pm UTC](https://forum.rasa.com/t/rasa-train-rasa-1-9-x-tensorflow-2-on-gpu/27299/6 "2020-11-20T16:13:19Z")

</div>

I had a similar issue (but with CUDA 11.1 and TF 2.1.2) and I found the solution here: [ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory · Issue #26182 · tensorflow/tensorflow · GitHub](https://github.com/tensorflow/tensorflow/issues/26182)

Basically my linux was pointing to the wrong CUDA lib, so I fixed it just adding the correct version to LD\_LIBRARY\_PATH

LD\_LIBRARY\_PATH=/usr/local/cuda-10.2/lib64${LD\_LIBRARY\_PATH:+:${LD\_LIBRARY\_PATH}}

I hope it helps! Paolo

---

<div class="post-metadata">

**Author:** ![kalpa916](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@kalpa916](https://forum.rasa.com/u/kalpa916)\
**Post date:** [July 6, 2022, 4:28am UTC](https://forum.rasa.com/t/rasa-train-rasa-1-9-x-tensorflow-2-on-gpu/27299/7 "2022-07-06T04:28:21Z")

</div>

@amvas How much time it took to train your model within 1 min or it it took around 2-3 minutes.Can you please let me know I can try
