python - 如何在 Tensorflow 中详尽地打印一维张量中的值而不得到截断的输出?

标签 python machine-learning tensorflow

我有一个一维张量。

所以当我打电话时

print(session.run(labels))

我得到 [0, 1, 0 ... , 0 1 0]

这是一个大约 1500 个值的列表,如何在不编写循环的情况下打印整个列表?

最佳答案

打印 session.run() 将输出为 numpy 数组。

您可以按如下方式设置打印选项:

import numpy
numpy.set_printoptions(threshold=numpy.nan)

I found the related answer from this stackoverflow question

关于python - 如何在 Tensorflow 中详尽地打印一维张量中的值而不得到截断的输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46639622/

相关文章:

python - 按下按键时保存图像 Python/Opencv

Python并行编程模型

Python + Scikit-learn :How to plot the curves of training score and validation score against the additive smoothing parameter alpha

python - PyGame 局部变量

python - 如何从 ThingSpeak channel 的特定字段访问值(数组)?

Python Pandas 列按计数排序

python-3.x - 如何在 F-beta 分数中选择 beta

tensorflow 精简版 : about input shape in tflite file

找不到 Tensorflow Lite labels.txt

tensorflow - 在 tensorflow 中移动图像(具有周期性边界)