报错:InternalError: Blas GEMM launch failed : a.shape=(32, 8), b.shape=(8, 30), m=32, n=30, k=8

报错:InternalError: Blas GEMM launch failed : a.shape=(32, 8), b.shape=(8, 30), m=32, n=30, k=8 [Op:MatMul]

解决办法:在import后添加如下代码并restart:

physical_devices = tf.config.experimental.list_physical_devices('GPU')
assert len(physical_devices) > 0, "Not enough GPU hardware devices available"
tf.config.experimental.set_memory_growth(physical_devices[0], True)

如果还不行,重启电脑即可。

好像还有其他方法,不过其他方法我没有亲试,在此附上链接:https://blog.csdn.net/Vinsuan1993/article/details/81142855

原创文章 46 获赞 49 访问量 2181

猜你喜欢

转载自blog.csdn.net/qq_41660119/article/details/105840558
今日推荐