Finally support for tensorflow on amd gpus

Here’s a quote from the developers:

ROCm Tensorflow 1.8 Release

 

We are excited to announce the release of ROCm enabled TensorFlow v1.8 for AMD GPUs. This post demonstrates the steps to install and use TensorFlow on AMD GPUs.

Installation

First, you’ll need to install the open-source ROCm stack. Details can be found here: https://rocm.github.io/ROCmInstall.html

Then, install these other relevant ROCm packages:

sudo apt update
sudo apt install rocm-libs miopen-hip cxlactivitylogger

And finally, install TensorFlow itself (via our pre-built whl package):

sudo apt install wget python3-pip 
wget http://repo.radeon.com/rocm/misc/tensorflow/tensorflow-1.8.0-cp35-cp35m-manylinux1_x86_64.whl
pip3 install ./tensorflow-1.8.0-cp35-cp35m-manylinux1_x86_64.whl

Now that TensorFlow is installed, let’s run a few workloads.

Image recognition

We’ll use one of TensorFlow’s tutorials as a quick and easy Inception-v3 image recognition workload: https://www.tensorflow.org/tutorials/image_recognition

Here’s how to run it:

cd ~ && git clone https://github.com/tensorflow/models.git
cd ~/models/tutorials/image/imagenet
python3 classify_image.py

After, you should see a list of labels with associated scores. Since the above script is for classifying a supplied image of a panda, that’s what the result indicates:

giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca (score = 0.89103)
indri, indris, Indri indri, Indri brevicaudatus (score = 0.00810)
lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens (score = 0.00258)
custard apple (score = 0.00149)
earthstar (score = 0.00141)

 

For more info have a look at the following links: 1, 2

Leave a Reply

Your email address will not be published. Required fields are marked *