Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
marcelTim opened this issue Jul 4, 2018 · 1 comment
Open

Comments

@marcelTim
Copy link

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 'label_names' (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
Copy link

因为你有空格

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants