Debugging the TensorFlow / Cuda error on AWS — ImportError: libcublas.so.9.0: cannot open shared object file

Photo by Romson Preechawit on Unsplash

Cause of error

Check our versions

pip list | grep tensorflow-gpu
ls -l /usr/local/cuda

Investigate issue

Option 1. Upgrading/Downgrading system Cuda

# Look at the current cuda version 
ls -l /usr/local/cuda
# Look at the required cuda version
ls /usr/local/cuda-9.0
# Remove softlink to current cuda version
sudo rm /usr/local/cuda
# Add softlink to new version
ln -s /usr/local/cuda-9.0 /usr/local/cuda

Option 2. Upgrading/Downgrading tensorflow-gpu

pip uninstall tensorflow-gpu 
pip install tensorflow-gpu==1.4.0
pip list | grep tensorflow

Thats all

Data Scientist | Python programmer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store