Keras flow_from_directory class index

后端 未结 3 2000
别那么骄傲
别那么骄傲 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:28

    Its pretty simple. When you pre-process your data, just replace the class labels with some specific integers (you can call it id). So, when you compute the loss or accuracy from the model's output, just compare the prediction with the ground truth in terms of integer labels (id).

    In case if you need the label text, you can get it back from the id (integer).

提交回复
热议问题