解决tensorflow打印tensor有省略号的问题
2020-02-13 13:05
2291 查看
先上代码:
import tensorflow as tf x = tf.ones(shape=[100, 200], dtype=tf.int32, name='x') y = tf.zeros(shape=[2, 3], dtype=tf.float32, name='y') with tf.Session() as sess: print(sess.run([x, y]))
输出结果如下:
如果我调试的时候想查看省略号代表的值是什么
只需要改成如下代码就行:
import tensorflow as tf import numpy as np #借助numpy模块的set_printoptions()函数,将打印上限设置为无限即可 np.set_printoptions(threshold=np.inf) x = tf.ones(shape=[10, 20], dtype=tf.int32, name='x') y = tf.zeros(shape=[2, 3], dtype=tf.float32, name='y') with tf.Session() as sess: print(sess.run(x, y))
输出结果如下:可以看到省略号的部分也都打出来了
以上这篇解决tensorflow打印tensor有省略号的问题就是小编分享给大家的全部内容了,希望能给大家一个参考
您可能感兴趣的文章:
相关文章推荐
- 解决 “ModuleNotFoundError: No module named 'tensorflow.keras'; 'tensorflow' is not a package”问题
- 解决tensorflow的"Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA Using TensorFlow backend."警告问题
- 解决anaconda安装tensorflow的“no module named tensorflow”问题
- 解决Tensorflow源码安装的之后TensorBoard 无法使用的问题
- Python调用TensorFlow出现“Cannot evaluate tensor using `eval()`: No default session is registered”错误问题的解决
- 解决tensorflow问题:Your CPU supports instructions that this TensorFlow binary was not compiled to use:……
- 使用anaconda安装TensorFlow,以及解决anaconda安装tensorflow的“no module named tensorflow”问题
- tensorFlow解决问题ImportError: No module named 'tensorflow.python.pywrap_tensorflow_internal'
- 利用WebBrowser彻底解决Web打印问题(包括后台打印)
- tensorflow版本API不兼容问题解决
- tensorboard使用问题解决记录
- 关于OUTLOOK 2007邮件无法打印的问题解决方法
- 安装TensorFlow遇到no module named ‘tensorflow’问题解决方法
- JasperReports+iReport打印为excel表头重复问题解决
- win7-tensorflow查看当前运算器件及无法正常切换CPU/GPU运算器件问题解决方案
- 解决R12中FND-凭证打印请求飘黄:OPP响应超时的问题
- android logcat 不打印的问题;解决
- 无root权限安装Tensorflow 并解决version `GLIBCXX_3.4.19' not found 问题
- 玩转打印机 打印问题解决方案集锦
- tensorflow训练中出现nan问题的解决