Solving Tensorflow Error – Could not load dynamic library ‘cudart64_101.dll’

Solving Tensorflow Error – Could not load dynamic library ‘cudart64_101.dll’ is a Python error which occurs when Tensorflow cannot find the required Cuda libraries.

In this article I am going to solve the error while I try explaining why the error is popping up in the first place, I will also introduce some solutions which worked for other developers and we will see if those solutions can solve the error in your unique situation.

Explaining Tensorflow Error – Could not load dynamic library ‘cudart64_101.dll’

Before we solve this error, let us try to understand it, the error simply occurs when Tensorflow cannot find the required Cuda libraries.

The error could look like something like this.

                                                                       #
W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
                                                                       #

Bellow, is a number of tested solutions that I have tried and worked for me.

Solution : install the latest cuda toolkit

The easiest solution to the issue is to start by navigating to the following url.

                                                                       #
https://developer.nvidia.com/cuda-10.1-download-archive-base
                                                                       #

Select exe(local) as installer type for windows.

Install it in custom mode if you have already installed some dependencies.

Navigate to the following path.

                                                                       #
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin
                                                                       #

Copy cudart64_101.dll and past it to the following path.

                                                                       #
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin
                                                                       #

Now, you can just try installing TensorFlow.

                                                                       #
W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
                                                                       #

The error message above should be gone.

I Hope this solution has worked for you.

If this article has been useful for your particular case, consider donating to our Kofi account, there is a red button at the top of this page.

Summing-up

I hope my article was helpful in solving this error, errors are part of our journey of coding with Python, keep learning, keep coding and cheers. If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/