prototorch_models/tests/test_examples.sh

36 lines
551 B
Bash
Raw Normal View History

2021-05-21 16:16:17 +00:00
#! /bin/bash
# Read Flags
gpu=0
while [ -n "$1" ]; do
case "$1" in
--gpu) gpu=1;;
-g) gpu=1;;
*) path=$1;;
esac
shift
done
python --version
echo "Using GPU: " $gpu
# Loop
failed=0
for example in $(find $path -maxdepth 1 -name "*.py")
2021-05-21 16:16:17 +00:00
do
echo -n "$x" $example '... '
export DISPLAY= && python $example --fast_dev_run 1 --gpus $gpu &> run_log.txt
2021-05-21 16:16:17 +00:00
if [[ $? -ne 0 ]]; then
2021-05-25 19:28:05 +00:00
echo "FAILED!!"
cat run_log.txt
failed=1
else
2021-05-25 19:28:05 +00:00
echo "SUCCESS!"
2021-05-21 16:16:17 +00:00
fi
rm run_log.txt
done
2021-05-25 19:28:05 +00:00
exit $failed