解决tensorflow2.4.0版本出现failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED错误的方法

方法参考了
https://github.com/tensorflow/tensorflow/issues/45070

在主代码中加入

physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)

即可解决这个错误

相当简单

猜你喜欢

转载自blog.csdn.net/qq_19313495/article/details/114114114
今日推荐