jazzsaxmafia / Weakly_detector

Tensorflow implementation of "Learning Deep Features for Discriminative Localization"
361 stars 87 forks source link

Solved: ValueError: invalid literal for int() with base 10: '' #13

Open marcelTim opened 6 years ago

marcelTim commented 6 years ago

What I did so far:

  1. I downloaded the caltech256 dataset from kaggle (link: https://www.kaggle.com/jessicali9530/caltech256)
  2. put the zip into the folder (~/WeaklyDetector/data/)
  3. extracted the zip and
  4. adjusted the variable 'dataset_path' in train.caltech.py (line 19) to (~/WeaklyDetector/data/256_ObjectCategories)

As i run the train.caltech.py file, following error occured: ValueError: invalid literal for int() with base 10: ''

What the algorithm does:

The algorithm reads all foldernames in the path we previously set in step 4 and split the name by the delimiter '.'. The numbers are stored in the variable 'labels' and the name of the corresponding classes in 'labelnames' (line 32). So the algorithm expects this folder only to contain folders with the scheme '[0-9]+.[A-z\-]+'. (in other words, there are some numbers, followed by a point and a name).

What raised the error and how to solve:

In the folder of step 4 there is a hidden folder, called '.DS_Store'. Apparently- this folder does not match the desired scheme. It seems to be necessary for mac users, though. With help of print commands i verified that the algorithm reads this folder. Splitting the name as described in the previous section leads to the empty label '' and the label_name 'DS_Store'. The algorithm tries to map the empty label to an int value, that is of course impossible.

Just remove that file and it should work. Or try to filter this specific file in the program.

tuqiangwang commented 5 years ago

因为你有空格