#!/bin/bash PROGPATH=$(realpath "$0") PROGDIR=$(dirname "${PROGPATH}") TRAINING_STEPS=40000 DATA_DIR=/data source "${PROGDIR}/shell.functions" source "${DATA_DIR}/.venv/bin/activate" export TF_CPP_MIN_LOG_LEVEL=9 export GLOG_minloglevel=2 export GRPC_VERBOSITY="ERROR" echo -e "\n===== Testing Python Environment =====\n" echo -e "\n===== Testing Cuda =====\n" "${PROGDIR}/cudainfo" python - 2>/dev/null <= 0: result = "Available - " + c.device else: result = "Not available" except: result = "Not available" print("GPU:", result) try: with tf.device("/CPU:0"): a = tf.random.normal([10000, 10000]) b = tf.random.normal([10000, 10000]) c = tf.matmul(a, b) result = "Available - " + c.device except: result = "Not available" print("CPU:", result) except: print("Tensorflow not available") EOF python - 2>/dev/null </dev/null </dev/null </dev/null && { echo "piper-sample-generator available" } || { echo "piper-sample-generator not available" } echo echo -e "\n===== Python Environment Testing Complete =====\n"