0%

1
dict((name, getattr(ref, name)) for name in dir(ref) if not name.startswith('_'))

直接delete失败
需要直接git rm file

1
2
3
4
5
6
7
# Get rid of the ticks
ax.set_xticks([])
ax.set_yticks([])

# Get rid of tick labels
ax.get_xaxis().set_ticklabels([])
ax.get_yaxis().set_ticklabels([])

1
2
3
4
5
6
7
8
9
>>> a = np.array([0, 1, 2])
>>> np.tile(a, 2)
array([0, 1, 2, 0, 1, 2])
>>> np.tile(a, (2, 2))
array([[0, 1, 2, 0, 1, 2],
[0, 1, 2, 0, 1, 2]])
>>> np.tile(a, (2, 1, 2))
array([[[0, 1, 2, 0, 1, 2]],
[[0, 1, 2, 0, 1, 2]]])

1
2
idx = np.random.permutation( n )
a = a[idx, :]

1
np.delete([1,3,2], [1])

debug的时候,调用h5py读取文件,
然后debug失败。

解决: 关闭h5py读取文件

  1. 计算图不在变量内部,它处在全局命名空间内
  2. placeholder的值一般是常量或者是numpy
  3. tf.get_variable(“count”, [])
1
2
3
4
5
6
初始化使用 初始化器和 tf.assign()
tf.get_variable("count", [])
tf.get_variable("count", [3, 8])
tf.assign(variable, zero_node)
tf.get_variable("count", [3, 8], initializers=const_init_node)
init = tf.global_vairables_initializer()

1
2
3
4
5
6
# Let your BUILD target depend on "//tensorflow/python/debug:debug_py"
# (You don't need to worry about the BUILD dependency if you are using a pip
# install of open-source TensorFlow.)
from tensorflow.python import debug as tf_debug

sess = tf_debug.LocalCLIDebugWrapperSession(sess)

1
2
3
4
5
6
7
8
with tf.name_scope('ab'):
a = tf.Variable(tf.constant(1), name="v1")

a.name
u'ab_1/v1:0'

a.op.name
u'ab_1/v1'