yinguobing / cnn-facial-landmark

Training code for facial landmark detection based on deep convolutional neural network.
MIT License
626 stars 182 forks source link

Error when execute extract_face_from_ibug.py #39

Closed abdou31 closed 5 years ago

abdou31 commented 5 years ago

Hello , I have organize my data , but when i execute extract_face_from_ibug.py i get this error :

python extract_face_from_ibug.py

PTS file numbers: 218597 0%| | 0/218597 [00:00<?, ?it/s] Traceback (most recent call last): File "extract_face_from_ibug.py", line 143, in main() File "extract_face_from_ibug.py", line 115, in main subset_name = head.split('/')[-2] IndexError: list index out of range

How can i solve it ? Thanks

abdou31 commented 5 years ago

This error is from windows os , If anyone get this problem , he should change subset_name= head.split('/')[-2]

by

subset_name = head.split(os.path.sep)[-2]

yinguobing commented 5 years ago

@abdou31 Glad you figure it out. I was developing in Linux and had not noticed that Windows is using a different way to separate directories. You can make a pull request to fix this permanently.

abdou31 commented 5 years ago

In order to give everyone their right , I really solved the error by asking a question in stackoverflow and someone gave me the solution : https://stackoverflow.com/questions/56166760/subset-name-head-split-2-indexerror-list-index-out-of-range/56167136#56167136