tensorflow2. X error could not load dynamic library ‘cudnn64_ 7.dll’

Time:2022-5-26

Go to the official website to download the required cuddn patch:Poke me

After will

tensorflow2. X error could not load dynamic library 'cudnn64_ 7.dll'

Copy all files to the corresponding

tensorflow2. X error could not load dynamic library 'cudnn64_ 7.dll'

Medium, OK.

Test get GPU:

import tensorflow as tf
tf.debugging.set_log_device_placement(True)
gpus = tf.config.experimental.list_physical_devices('GPU')
for gpu in gpus:
    tf.config.experimental.set_memory_growth(gpu, True)
print(gpus)
logical_gpus = tf.config.experimental.list_logical_devices('GPU')
print(logical_gpus)

c = []
for gpu in logical_gpus:
    print(gpu.name)
    with tf.device(gpu.name):
        a =tf.constant([[1.0, 2.0, 3.0],[4.0, 5.0, 6.0]])
        b = tf.constant([[1.0, 2.0], [3.0, 4.0],[5.0, 6.0]])
        c.append(tf.matmul(a, b))
with tf.device('/CPU:0'):
    matmul_sum = tf.add_n(c)

print(matmul_sum)

Test results:

“`

This work adoptsCC agreement, reprint must indicate the author and the link to this article

article!! Started on my blogStray_Camel(^U^)ノ~YO