🧹 2020-03-tensorflow-vs-tensorflow-gpu/tensorflow-vs-tensorflow-gpu
parent
f1d94f72c7
commit
be86f9b28a
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
for version in "1.15.*" "2.1.*"; do
|
||||
for requirement in "tensorflow==$version" "tensorflow-gpu==$version"; do
|
||||
for CUDA_VISIBLE_DEVICES in "0" ""; do
|
||||
|
||||
echo "== $requirement, CUDA_VISIBLE_DEVICES='$CUDA_VISIBLE_DEVICES'"
|
||||
|
||||
export CUDA_VISIBLE_DEVICES
|
||||
|
||||
venv=`mktemp -d /tmp/test-nvidia.XXXXX`
|
||||
virtualenv --quiet -p /usr/bin/python3 $venv
|
||||
. $venv/bin/activate
|
||||
|
||||
pip3 install --quiet --upgrade pip
|
||||
pip3 install --quiet "$requirement"
|
||||
|
||||
python3 -c 'import tensorflow as tf; print("GPU available:", tf.test.is_gpu_available())'
|
||||
|
||||
deactivate
|
||||
rm --preserve-root -rf "$venv/"
|
||||
done
|
||||
done
|
||||
done
|
@ -1,19 +0,0 @@
|
||||
#!/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
|
Loading…
Reference in New Issue