Keras flow_from_directory class index

后端 未结 3 1956
别那么骄傲
别那么骄傲 2021-02-08 08:43

I used to make it manually, but i am using now flow_from_directory to train my network with my own data. I just have one question. When i make model.predict(), how can i know th

3条回答
  •  生来不讨喜
    2021-02-08 09:26

    When you gather data, you define that. There is no rule. But a simple way to check is:

    • see what your first training image is, look at it yourself: is it a cat or a dog?
    • then see the training Y (result/class/desired output), is it [0,1] or [1,0]?

    This will answer your question.

    For getting one sample from a generator, you can see this question: How to get one value from a generator in Python?

    As defined in Keras documentation, the generator output is a tuple of (inputs, targets)

提交回复
热议问题