foamliu / Car-Recognition

Car Recognition with Deep Learning
MIT License
345 stars 135 forks source link

Typo in analyze.py #22

Open JamesMDe opened 4 years ago

JamesMDe commented 4 years ago

Hello,

My coworker and I were trying to run analyze.py and received the following error:

Traceback (most recent call last): File "analyze.py", line 106, in y_pred, y_test = predict('data/valid', model) File "analyze.py", line 44, in predict class_id = int(tokens[-2]) IndexError: list index out of range

It appears that os.pathsep that is passed into the split function on line 44 in analyze.py is using a ':' as a delimiter instead of a '/'. Replacing this with os.path.sep fixes the issue.

Usman-Ghani123 commented 4 years ago

Use this instead of the one in the code it will solve the problem. tokens=img_path.split('\')

(Use back Slash twice)