在训练脚本的前面加上 下面代码:
import tensorflow as tf import keras config = tf.ConfigProto() config.gpu_options.allow_growth = True keras.backend.tensorflow_backend.set_session(tf.Session(config=config))
Powered by: 博客园 Copyright © 2024 Alex_bd Powered by .NET 8.0 on Kubernetes