tensorflow2.x 报错 Could not load dynamic library 'cudnn64_7.dll'

2020年6月10日 01:48 阅读 164 评论 0

前往官网下载所需得cuddn补丁:戳我

之后将

tensorflow2.x 报错 Could not load dynamic library 'cudnn64_7.dll' 文件全部复制到相应得 tensorflow2.x 报错 Could not load dynamic library 'cudnn64_7.dll'

中,即可。

测试获取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)

测试结果: ```

原创文章,转载请注明出处:https://boywithacoin.cn/article/tensorflow2-x-bao-cuo-could-not-load-dynamic-library-cudnn64-7-dll/


您尚未登录,请 登录注册 后评论
    0 人参与 | 0 条评论
    暂时没有评论,欢迎来尬聊!