小行星

热爱平淡,向往未知


  • 首页

  • 分类

  • 归档

  • 关于

  • 阅读排行

  • 搜索

cv2.imread 256范围内

发表于 2018-07-Thu | 阅读次数:

cv2.imread 256范围内

e2dict

发表于 2018-07-Thu | 阅读次数:
1
dict((name, getattr(ref, name)) for name in dir(ref) if not name.startswith('_'))

git delete

发表于 2018-07-Tue | 阅读次数:

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

python画图 取消ticks, labels

发表于 2018-07-Tue | 阅读次数:
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([])

np tile使用

发表于 2018-07-Tue | 阅读次数:
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]]])

shuffle data

发表于 2018-07-Tue | 阅读次数:
1
2
idx = np.random.permutation( n )
a = a[idx, :]

np.delete

发表于 2018-07-Tue | 阅读次数:
1
np.delete([1,3,2], [1])

h5py debug冲突

发表于 2018-07-Mon | 阅读次数:

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

解决: 关闭h5py读取文件

tensorflow 理解

发表于 2018-07-Mon | 阅读次数:
  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()

tfdbg使用

发表于 2018-07-Mon | 阅读次数:
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…293031…59
fangyh

fangyh

最爱的是那苍穹之外的浩渺宇宙

588 日志
4 分类
66 标签
© 2020 fangyh
由 Hexo 强力驱动
|
主题 — NexT.Mist v5.1.3
|本站总访问量次