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

Value Error: Face Training #11

Open
IndrajeetDevale opened this issue Mar 24, 2020 · 2 comments
Open

Value Error: Face Training #11

IndrajeetDevale opened this issue Mar 24, 2020 · 2 comments

Comments

@IndrajeetDevale
Copy link

id = int(os.path.split(imagePath)[-1].split(".")[1])
ValueError: invalid literal for int() with base 10: 'Shubham'

Getting an invalid literal issue while using trying to implement face training. Could not find a solution on stackoverflow. Will be greatful if you help. Thank You!

@aniiketdongare07
Copy link

I have the same error, pl someone let me know if you find anything

@lasupernova
Copy link

lasupernova commented May 19, 2021

I changed that line and used regex to extract the ids:
id = re.search(r'(?:face-)(\d+)(?:.*)', imagePath).group(1) (see below)

you also need import re at the beginning in order to use the re library

EDIT:

IDs need to be integers, but the solution above returns strings, so instead use:
id = int(re.search(r'(?:face-)(\d+)(?:.*)', imagePath).group(1))

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

3 participants