我怎样才能到达复合MinibatchSource的流?

时间:2017-01-10 20:31:22

标签: cntk

如果我像这样创建一个MinibatchSource:

reader_test = MinibatchSource(ImageDeserializer('test_map.txt', StreamDefs(
    features = StreamDef(field='image', transforms=transforms), # first column in map file is referred to as 'image'
    labels   = StreamDef(field='label', shape=num_classes)      # and second as 'label'
)))

然后我可以进入这样的功能流:

reader_test.streams.features

但是,如果我像这样创建MiniBatchSource:

image_source = ImageDeserializer('test_map.txt', StreamDefs(
    features = StreamDef(field='image', transforms=transforms), # first column in map file is referred to as 'image'
    labels   = StreamDef(field='label', shape=num_classes)      # and second as 'label'
))

text_source = CTFDeserializer("test_map2.txt")
text_source.map_input('index', dim=1, format="dense")
text_source.map_input('piece_type', dim=6, format="dense")

# define a composite reader
reader_config = ReaderConfig([image_source, text_source])
mb_source = reader_config.minibatch_source()

试试这个:

mb_source.streams.features

结果:

AttributeError: 'MinibatchSource' object has no attribute 'streams'

如何进入功能流?

1 个答案:

答案 0 :(得分:-1)

很久以前就已经修好了。