with tf.Session() as sess:
换成下面这三句
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
with tf.Session(config=config) as sess:
with tf.Session() as sess:
换成下面这三句
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
with tf.Session(config=config) as sess: