Search code examples
pythontensorflowkerasgoogle-colaboratory

Creating three classes instead of two - library keras


To start with, I'd like to write that I found this subject: Keras creating three classes instead of two - but it didn't answer to my problem.

I use the googlecolab in my work. I am doing machine learning, and I divided my collection into the following three categories: test, train, valid (the structure is shown in the attached photo). enter image description here When I execute my code, which operates on decision classes (which are two: yes and no), the program finds three classes although there are only two in my folder structure. The output code fragment, which shows the number of found classes and given objects in the classes is also shown in the picture.
enter image description here

How can I see if I have any hidden folders? Is there any way to solve my problem?


Solution

  • All right, all clear. I was manually uploading the files, and I solved my problem with this video. The solution is that I uploaded a package (.zip) and then unpacked it with python code.

    from zipfile import ZipFile
    file_name = "data.zip"
    
    with ZipFile(file_name, 'r') as zip:
      zip.extractall()
      print('Done')
    

    Probably during manual folder creation in 'google colab' an additional hidden folder is created, to which we have no access, and during code execution it is visible to the program. When I packed my data and threw it in as a .zip the extra class problem disappeared.