tensorflow和tensorflow2.0控制显存
tensorflow
一个面向所有人的开源机器学习框架
项目地址:https://gitcode.com/gh_mirrors/te/tensorflow

·
tensorflow和tensorflow2.0控制显存
下面的方法可以控制tensorflow或keras实现显存自适应。
if tf.__version__.startswith('1.'): # tensorflow 1
config = tf.ConfigProto() # allow_soft_placement=True
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
else: # tensorflow 2
tf.config.gpu.set_per_process_memory_growth(enabled=True)
tensorflow
一个面向所有人的开源机器学习框架
项目地址:https://gitcode.com/gh_mirrors/te/tensorflow
第一个方法用于控制tensorflow 1.x版本使用自适应显存,避免显存独占。第二个方法用于控制tensorflow 2.x 使用自适应显存。
原文地址:https://doit-space.blog.csdn.net/article/details/102911328




一个面向所有人的开源机器学习框架
最近提交(Master分支:1 个月前 )
4f64a3d5
Instead, check for this case in `ResolveUsers` and `ResolveOperand`, by querying whether the `fused_expression_root` is part of the `HloFusionAdaptor`.
This prevents us from stepping into nested fusions.
PiperOrigin-RevId: 724311958
1 个月前
aa7e952e
Fix a bug in handling negative strides, and add a test case that exposes it.
We can have negative strides that are not just -1, e.g. with a combining
reshape.
PiperOrigin-RevId: 724293790
1 个月前
更多推荐
目录
所有评论(0)