如何调试Tensorflow网络权重/输出/每个输入样本的成本?

我制作了一个张量流模型.
但由于某种原因,总会得到NAN损失.
我想知道如何调试和查看每个张量中的每个值.

例如: –

 out = tf.add(tf.matmul(outputs[-1], _weights['out']), _biases['out'])

在运行期间,我想查看此张量中的值,并查看出错的位置.
我在post中找到了类似的东西

他们在哪里做这样的事情

out = tf.add(tf.matmul(outputs[-1], _weights['out']), _biases['out'])
out = tf.Print(out, [out], message="This is softmax Output: ")

但是这样的放弃和放弃

I tensorflow/core/kernels/logging_ops.cc:79] This is softmax Output: [2.148583e-08 5.9002307e-08 -9.90654e-08...]
I tensorflow/core/kernels/logging_ops.cc:79] This is softmax Output: [nan nan nan...]
I tensorflow/core/kernels/logging_ops.cc:79] This is softmax Output: [nan nan nan...]
Iter 64, Minibatch Loss= nan, Training Accuracy= 0.01562
Testing Accuracy: 0.0
I tensorflow/core/kernels/logging_ops.cc:79] This is softmax Output: [nan nan nan...]
I tensorflow/core/kernels/logging_ops.cc:79] This is softmax Output: [nan nan nan...]
I tensorflow/core/kernels/logging_ops.cc:79] This is softmax Output: [nan nan nan...]
I tensorflow/core/kernels/logging_ops.cc:79] This is softmax Output: [nan nan nan...]

哪个不是那么有用,因为我无法查看所有值.
我想知道是否有一步一步的调试选项?

解决方法:

TensorFlow现在有一个名为tfdbg的内置调试器.它暴露了图中的中间张量以及图形结构,这样可以使您更容易调试此类问题.与print ops相比,它需要更少的代码更改并提供更好的图形覆盖率.

请查看主HEAD的文档/教程:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/how_tos/debugger/index.md

相关文章

MNIST数据集可以说是深度学习的入门,但是使用模型预测单张M...
1、新建tensorflow环境(1)打开anacondaprompt,输入命令行...
这篇文章主要介绍“张量tensor是什么”,在日常操作中,相信...
tensorflow中model.fit()用法model.fit()方法用于执行训练过...
https://blog.csdn.net/To_be_little/article/details/12443...
根据身高推测体重const$=require('jquery');const...