Skip to content

Commit

Permalink
PPoPP generate_results.sh: Verify Python version 3.6 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jthestness authored Nov 23, 2018
1 parent 912ed61 commit be06bb9
Showing 1 changed file with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
#!/bin/bash

# Check for correct Python version
pyversion=`python --version 2>&1 | grep -o "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*"`
major=`echo $pyversion | sed 's/\..*//'`
minor=`echo $pyversion | sed 's/[0-9]*\.\([0-9]*\)\..*/\1/'`
if [ "$major" != "3" ] || [ "$minor" != "6" ]
then
USEPYTHON=`which python3.6`
if [ ! -e "$USEPYTHON" ]
then
echo "ERROR: Python version $pyversion not supported. Please use Python 3.6"
exit
fi
else
USEPYTHON=`which python`
fi

# Set up virtual environment
if [ ! -e "catamount_venv" ]
then
echo "==== Creating virtual environment ===="
python -m venv catamount_venv
$USEPYTHON -m venv catamount_venv
echo ""
fi

echo "==== Sourcing virtual environment ===="
activatescript="catamount_venv/bin/activate"
if [ ! -e "$activatescript" ]
then
echo "ERROR: Failed to create virtualenv, catamount_venv. Unable to find $activatescript"
exit
fi
source catamount_venv/bin/activate
export PYTHONPATH=$VIRTUAL_ENV/lib/python3.6/site-packages/
echo ""
Expand All @@ -18,7 +40,7 @@ pip install -r requirements.txt
echo ""

echo "==== Installing Catamount ===="
python setup.py install
$USEPYTHON setup.py install
echo ""

outdir="ppopp_2019_tests"
Expand All @@ -36,21 +58,21 @@ for depth in 18 34 50 101 152
do
outfile="$outdir/output_image_$depth.txt"
echo "==== Running Image ResNet$depth. Output to $outfile ===="
CUDA_VISIBLE_DEVICES="" python catamount/tests/full/tf_image_resnet.py --depth $depth >& $outfile
CUDA_VISIBLE_DEVICES="" $USEPYTHON catamount/tests/full/tf_image_resnet.py --depth $depth >& $outfile
echo ""
done

for domain in charlm nmt wordlm
do
outfile="$outdir/output_$domain.txt"
echo "==== Running Language $domain. Output to $outfile ===="
CUDA_VISIBLE_DEVICES="" python catamount/tests/full/tf_language_models.py --domain $domain >& $outfile
CUDA_VISIBLE_DEVICES="" $USEPYTHON catamount/tests/full/tf_language_models.py --domain $domain >& $outfile
echo ""
done

outfile="$outdir/output_speech.txt"
echo "==== Running Speech Attention. Output to $outfile ===="
CUDA_VISIBLE_DEVICES="" python catamount/tests/full/tf_speech_attention.py >& $outfile
CUDA_VISIBLE_DEVICES="" $USEPYTHON catamount/tests/full/tf_speech_attention.py >& $outfile
echo ""


Expand Down

0 comments on commit be06bb9

Please sign in to comment.