解決AttributeError: module 'tensorflow' has no attribute 'ConfigProto'

使用CUDA10.1加上Tensorflow 2.0會出現AttributeError: module 'tensorflow' has no attribute 'ConfigProto'這個問題,這個是由於現在新版本中一些1.0版本的函數被和2.0版本函數區分開的緣故   所以,需要將 tf.ConfigProto 修改爲 tf.compat.v1.ConfigProto 修改前 修改後
相關文章
相關標籤/搜索