0

I recently sat the tensorflow developer exam (https://www.tensorflow.org/certificate) and encountered an error which I think may be a bug. I found a fix on this stackoverflow, but I can't comment on it to highlight it to prospective exam candidates (don't have enough reputation). Hopefullly I'll be able to save someone a bit of a headache in the exam situation.

I configured my environment as per exam recommendations for Windows10 on 01/12/20 (https://www.tensorflow.org/extras/cert/Setting_Up_TF_Developer_Certificate_Exam.pdf) Tensorflow 2.3.0 cuda 10.1.2 cudnn sdk 7.6.5 python 3.8.0 nvidia geforce 1060 driver 457.30

I cannot include the code which generated the error, as it is part of the exam.

Although my code executed properly in the console, when I clicked run on the exam starter scripts, I recieved the following error:

"

tensorflow.python.framework.errors_impl.InternalError: Blas GEMV launch failed: m=1, n=6 [[node sequential/dense/MatMul (defined at #######) ]] [Op:__inference_train_function_463]

Function call stack: train_function

Process finished with exit code 1 "

user160623
  • 196
  • 2
  • 5

1 Answers1

1

Although I can't provide the source code for the error (as it is a question in a publicly available exam), please follow these instructions. I found the solution in this question.

Tensorflow crashes with CUBLAS_STATUS_ALLOC_FAILED

Credit goes to Snympi, who found the solution on this page https://www.tensorflow.org/guide/gpu.

Add the following code to the beginning of every starter script, immediately after importing the required packages.

gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
    try:
        # Currently, memory growth needs to be the same across GPUs
        for gpu in gpus:
            tf.config.experimental.set_memory_growth(gpu, True)
        logical_gpus = tf.config.experimental.list_logical_devices('GPU')
        print(len(gpus), "Physical GPUs,", len(logical_gpus), "Logical GPUs")
    except RuntimeError as e:
        # Memory growth must be set before GPUs have been initialized
        print(e)
user160623
  • 196
  • 2
  • 5