tensorflow-keras-cpu-gpu/README.md

26 lines
1.6 KiB
Markdown

# GPU / CPU Benchmarks for tensorflow and keras
The benchmarks run on all the devices that tensorflow finds. If that should include a GPU, make sure to install the python egg `tensorflow-gpu`, also make sure the nvidia kernel module has the version supported by your cuda installation, in my case I needed the ubuntu-package `nvidia-384==384.111-0ubuntu1` (the 111-part also has to match). You'll see an error message in the **console** (not the notebook) when importing tensorflow and the versions mismatch. Also make sure cuda is in your `LD_LIBRARY_PATH`, in my case `/usr/local/cuda-8.0/targets/x86_64-linux/lib/` for the ubuntu package `cuda-8.0`, the folder should contain object files like `libcudnn.so` ('updatedb' and `locate libcuda.so` to find such a folder on your linux system).
Run the benchmarks preferrably in a virtualenv with `python>=3.4,<4`
virtualenv --python=/usr/bin/python3 gpubenchmark
source gpubenchmark/bin/activate
pip3 install numpy scipy tensorflow-gpu keras jupyter
jupyter-notebook # starts a http-server
instead of running `jupyter-notebook`, you can also make python-scripts.
## Experiments
Benchmark for matrix multiplication in tensorflow
[Matrix multiplication benchmark](01.%20Matrix%20multiplication.ipynb)
Benchmark for training and predicting on a 5-layer neural network in keras+tensorflow
[4-layer Dense Neural Network](02.%20Simple%20Neural%20Network%20training%20+%20evaluation.ipynb)
Benchmarks for predictions using ResNet50, Inception v3, VGG16 and VGG19
[Popular deep learning models](03.%20Popular%20image%20classification%20models.ipynb)