Tensorflow常见报错处理

Posted 半个王子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Tensorflow常见报错处理相关的知识,希望对你有一定的参考价值。

1. CUDA_ERROR_OUT_OF_MEMORY
import tensorflow as tf

# 避免 CUDA_ERROR_OUT_OF_MEMORY
config = tf.ConfigProto(allow_soft_placement=True)
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.7)
config.gpu_options.allow_growth = True

sess = tf.Session(config=config)

a = tf.placeholder("float")
b = tf.placeholder("float")
c = tf.constant(6.0)
d = tf.multiply(a, b)
y = tf.multiply(d, c)
print sess.run(y, feed_dict={a: 3, b: 3})

以上是关于Tensorflow常见报错处理的主要内容,如果未能解决你的问题,请参考以下文章

centos yum安装python2.7及常见报错处理

云桌面登录常见报错

|NO.Z.00001|——————————|^^ 构建 ^^|——|Nginx&Nginx常见报错&解决方案|

ssh远程主机 常见报错处理

后台常见报错处理

linux 安装mysql8.0及常见报错处理