2

我在https://github.com/maxim5/hyper-engine上找到了超引擎 python 工具 。

仅使用 mnist 的示例。 https://github.com/maxim5/hyper-engine/tree/master/hyperengine/examples

我怎样才能像下面这个例子一样提供我自己的数据: https ://github.com/aymericdamien/TensorFlow-Examples/blob/master/notebooks/5_DataManagement/build_an_image_dataset.ipynb

4

1 回答 1

0

HyperEngine supports custom data provider, the closest example is this one: it's generating word pairs from the text, not images, but the API is more or less clear. Basically, you only need to implement next_batch method:

def next_batch(self, batch_size):
  pass

So if you want to train your network on a set of images on a disk, you simply need to write an iterator over files and yield numpy arrays upon calling the next batch.

But there is a but. Currently, HyperEngine is accepting only numpy arrays from next_batch. The example you refer to is working with TF queue API and read_images function is producing tensors, so you can't simply copy the code. Hopefully, will be a better support for various tensorflow APIs, including estimators, dataset API, queues, etc.

于 2018-03-23T09:42:46.720 回答