我有一个程序生成的(无限)数据源,我试图用它作为高级Tensorflow的输入Estimator来训练基于图像的3D物体探测器.
我在Tensorflor Estimator Quickstart中设置数据集,我dataset_input_fn返回一个功能和标签的元组Tensor,就像Estimator.train函数指定的那样,以及本教程的显示方式,但是在尝试调用train功能时遇到错误:
TypeError: 'Tensor' object is not iterable.
我究竟做错了什么?
def data_generator():
"""
Generator for image (features) and ground truth object positions (labels)
Sample an image and object positions from a procedurally generated data source
"""
while True:
source.step() # generate next data point
object_ground_truth = source.get_ground_truth() # list of 9 floats
cam_img = source.get_cam_frame() # image (224, 224, 3)
yield (cam_img, object_ground_truth)
def dataset_input_fn():
"""
Tensorflow `Dataset` …Run Code Online (Sandbox Code Playgroud) 当使用ReLU时,从深入研究整流器开始,他/ MSRA初始化似乎是推荐的权重初始化。
在TensorFlow中是否有内置的方式使用它?(类似于:如何在TensorFlow上进行Xavier初始化)?