tensorflow-vs-tensorflow-gpu

This commit is contained in:
Gerber, Mike 2020-02-25 18:14:03 +01:00
parent 817d439b7d
commit 2e8ea7040a

19
tensorflow-vs-tensorflow-gpu Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
for package in "tensorflow==1.15.*" "tensorflow-gpu==1.15.*"; do
for CUDA_VISIBLE_DEVICES in "0" ""; do
echo "== $package, CUDA_VISIBLE_DEVICES='$CUDA_VISIBLE_DEVICES'"
export CUDA_VISIBLE_DEVICES
venv=/tmp/tmp.$RANDOM
virtualenv --quiet -p /usr/bin/python3 $venv
. $venv/bin/activate
pip3 install --quiet --upgrade pip
pip3 install --quiet "$package"
python3 -c 'import tensorflow as tf; print("GPU available:", tf.test.is_gpu_available())'
done
done