demo_yolo_v2.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:yolov2-tensorflow 作者: shishichang 项目源码 文件源码
def setup_meta_ops(self):
        cfg = dict({
            'allow_soft_placement': False,
            'log_device_placement': False
            })
        utility = min(self.gpu_utility, 1.0)
        if utility > 0.0:
            print('GPU model with {} usage'.format(utility))
            cfg['gpu_options'] = tf.GPUOptions(per_process_gpu_memory_fraction = utility)        
            cfg['allow_soft_placement'] = True
        else:
            print('Run totally on CPU')
            cfg['device_count'] = {'GPU': 0}

        self.sess = tf.Session(config = tf.ConfigProto(**cfg))
        self.sess.run(tf.global_variables_initializer())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号