tangjunjun

 

import tensorflow as tf
import os
os.environ["CUDA_VISIBLE_DEVICES"] = \'0\' #指定第一块GPU可用
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.5 # 程序最多只能占用指定gpu50%的显存
config.gpu_options.allow_growth = True #程序按需申请内存
sess = tf.Session(config = config)

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-06-16
  • 2022-03-03
  • 2021-12-31
  • 2022-01-02
  • 2022-12-23
  • 2021-06-01
  • 2021-10-03
猜你喜欢
  • 2021-12-07
  • 2021-06-18
  • 2021-12-04
  • 2022-03-04
  • 2021-12-31
  • 2021-12-07
相关资源
相似解决方案