运行以下代码,进入~/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/rnn.py和~/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/rnn_cell.py单步追踪调试

调试中import tensorflow as tf,利用tf.Session().run(variable)打印变量

查看BasicRNNCell和dynamic_rnn的实现方式

 #-*-coding:utf8-*-

 __author = "buyizhiyou"
__date = "2017-11-20" '''
单步调试,学习rnn的tf实现
'''
import tensorflow as tf
import numpy as np
import pdb X = tf.random_normal(shape=[2,3,4], dtype=tf.float32)#(2,3,4)==>(Batch_size,Time_steps(序列长度),Data_Vector)
pdb.set_trace()
cell = tf.nn.rnn_cell.BasicRNNCell(10)#output_size:10,也可以换成GRUCell,LSTMAACell,BasicRNNCell
state = cell.zero_state(2, tf.float32)#batch_size:2
output, state = tf.nn.dynamic_rnn(cell, X, initial_state=state, time_major=False)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
print (output.get_shape())
print (sess.run(state))

tensorflow BasicRNNCell调试的更多相关文章

  1. Tensorflow之调试(Debug) && tf.py_func()

    Tensorflow之调试(Debug)及打印变量 tensorflow调试tfdbg 几种常用方法: 1.通过Session.run()获取变量的值 2.利用Tensorboard查看一些可视化统计 ...

  2. tensorflow安装调试总结(持续更新)

    这段时间需要部署tensorflow到linux上,由于堡垒机不能连外网,所以pip.apt-get.wget.git统统不能用,然后就是各种调试了,下面整理了一些遇到的问题和解决方案,供大家参考(C ...

  3. tensorflow tfdbg 调试手段

    https://blog.csdn.net/gubenpeiyuan/article/details/82710163 TensorFlow 调试程序 tfdbg 是 TensorFlow 的专用调试 ...

  4. Tensorflow之调试(Debug)及打印变量

    参考资料:https://wookayin.github.io/tensorflow-talk-debugging 几种常用方法: 1.通过Session.run()获取变量的值 2.利用Tensor ...

  5. Debugging TensorFlow models 调试 TensorFlow 模型

    Debugging TensorFlow models Symbolic nature of TensorFlow makes it relatively more difficult to debu ...

  6. tensorflow学习——调试ctc的两个bug

    InvalidArgumentError (see above for traceback): Not enough time for target transition sequence (requ ...

  7. 学习笔记TF063:TensorFlow Debugger

    TensorFlow Debugger(tfdbg),TensorFlow专用调试器.用断点.计算机图形化展现实时数据流,可视化运行TensorFlow图形内部结构.状态.有助训练推理调试模型错误.h ...

  8. 【转载】史上最全:TensorFlow 好玩的技术、应用和你不知道的黑科技

    [导读]TensorFlow 在 2015 年年底一出现就受到了极大的关注,经过一年多的发展,已经成为了在机器学习.深度学习项目中最受欢迎的框架之一.自发布以来,TensorFlow 不断在完善并增加 ...

  9. 使用NNI的scikit-learn以及Tensorflow分析

    一.NNI简介 NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包. 它通过多种调优的算法来搜索最好的神经网络结构和(或)超参,并支持单机.本地 ...

随机推荐

  1. LeetCode -- Sum Root to Leaf NNumbers

    Related Links: Path Sum: http://www.cnblogs.com/little-YTMM/p/4529982.html Path Sum II: http://www.c ...

  2. [bzoj3813] 奇数国 [线段树+欧拉函数]

    题面 传送门 思路 这题目是真的难读......阅读理解题啊...... 但是理解了以后就发现,题目等价于: 给你一个区间,支持单点修改,以及查询一段区间的乘积的欧拉函数值,这个答案对19961993 ...

  3. gdb调试的艺术——Debug技巧

    调试的艺术——Debug技巧总结 (本文从写好的wiki里粘出来的,格式稍乱不影响阅读) 用Q+编号代表问题,A+编号代表答案.用这种方式组织.如无特别说明,这些技巧都是针对Visual Studio ...

  4. [解决方案]未能找到路径“~\bin\roslyn\csc.exe”的一部分

    我的WebApi项目使用Nuget加载了一些包以后出现了这样的问题,本地可以访问,但发布到线上后,出现这样的报错 这个问题出现的原因是Nuget的时候,多加载了一些项目可能不需要的依赖库所导致的. 解 ...

  5. Windows转移FSMO角色

    转移 FSMO 角色若要使用 Ntdsutil 实用工具转移 FSMO 角色,请按照下列步骤操作:1.登录到基于 Windows 2000 Server 或基于 Windows Server 2003 ...

  6. getElementsByName

    name属性,name属性是input标签的内建属性,早期浏览器的getElementsByName方法是为了方便的获取用户的输入.由于name只是input的内建属性,其它标签没有,所以getEle ...

  7. nginx简易部署

    Nginx (engine x) 可作为web反向代理服务器.能够代理外部网络上的主机,访问内部网络 1 首先windows下载nginx :http://nginx.org/download/ngi ...

  8. 阿里云Centos 7 FTP(vsftp)服务安装及配置

    #检查vsftpd是否安装 rpm -qa | grep vsftpd #检查vsftpd版本并安装 yum list vsftpd yum install vsftpd #设置开机启动 system ...

  9. 洛谷P3112 [USACO14DEC]后卫马克Guard Mark

    题目描述 Farmer John and his herd are playing frisbee. Bessie throws the frisbee down the field, but it' ...

  10. 搭建github服务器

    https://about.gitlab.com/downloads/#centos6