1. slim.arg_scope(函数, 传参) # 对于同类的函数操作,都传入相同的参数 from tensorflow.contrib import slim as slim import tensorflow as tf @slim.add_arg_scope # 进行修饰操作 def fun1(a=0, b=0): return a + b with slim.arg_scope([fun1], a=2): x = fun1(b=2) print(x)# 4 2. tf.name_sc…
tf.split(input, num_split, dimension): dimension指输入张量的哪一个维度,如果是0就表示对第0维度进行切割:num_split就是切割的数量,如果是2就表示输入张量被切成2份,每一份是一个列表. 例如: import tensorflow as tf; import numpy as np; A = [[1,2,3],[4,5,6]] x = tf.split(A, 3, 1) with tf.Session() as sess: c = sess.…
最近在使用目标识别api,但是报错了: File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/script_ops.py", line 158, in __call__ ret = func(*args) File "/home/lyz/code/share_pro/models/research/object_detection/utils/visualization_utils.py"…