Failed precondition: Python interpreter state is not initialized. The process may be terminated

只需要添加以下两行代码就可以了

gpus = tf.config.experimental.list_physical_devices(‘GPU’)
tf.config.experimental.set_memory_growth(gpus[0], True)

你可能感兴趣的:(waring解决,tensorflow,神经网络,cv)