config = tf.ConfigProto(
device_count={'GPU': 1},
intra_op_parallelism_threads=1,
allow_soft_placement=True
)

config.gpu_options.allow_growth = True
config.gpu_options.per_process_gpu_memory_fraction = 0.6

session = tf.Session(config=config)

keras.backend.set_session(session)

 

with session.as_default():
  with session.graph.as_default():

    predict_result = modell.predict([X1,X2])

posted on 2020-06-28 16:07  yingxinff  阅读(97)  评论(0编辑  收藏  举报