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

Exception in TKinter callback #6

Open
divyasri456 opened this issue Dec 14, 2018 · 22 comments
Open

Exception in TKinter callback #6

divyasri456 opened this issue Dec 14, 2018 · 22 comments

Comments

@divyasri456
Copy link

Been stuck at this point. please help me out from this

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\divya\AppData\Local\Programs\Python\Python37-32\lib\tkinter_init_.py", line 1702, in call
return self.func(*args)
File "train.py", line 161, in TrainImages
recognizer = cv2.face_LBPHFaceRecognizer.create()#recognizer = cv2.face.LBPHFaceRecognizer_create()#$cv2.createLBPHFaceRecognizer()
AttributeError: module 'cv2.cv2' has no attribute 'face_LBPHFaceRecognizer'

@mayurkadampro
Copy link

module 'cv2.cv2' has no attribute 'face_LBPHFaceRecognizer'

I made changes in that train.py file you can check out from pull request else check out forked repo in my profile and now it's working fine.

@kitayya
Copy link

kitayya commented Feb 1, 2019

Key Error: 'Id'

@kitayya
Copy link

kitayya commented Feb 1, 2019

error is coming while tracking an image. what have to do now?
Like below error is coming
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\VENKAT\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2602, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

@mayurkadampro
Copy link

error is coming while tracking an image. what have to do now?
Like below error is coming
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\VENKAT\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2602, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

well, this kind of error does not appear when i am running and still if you have a problem with this then you can check out my repository i made some changes in it. and now its work very fine.

@kitayya
Copy link

kitayya commented Feb 1, 2019

I checked your repository also but still same problem is coming..
what i have to do?
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\VENKAT\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2602, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

@mayurkadampro
Copy link

mayurkadampro commented Feb 2, 2019

I checked your repository also but still same problem is coming..
what i have to do?
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\VENKAT\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2602, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

then it's weird bcoz I test it then upload it. so installed all the latest version of a module then try it on python 3
pip install opencv-python
pip install pytest-shutil
pip install pandas
pip install pillow
hope it works

@nonokh
Copy link

nonokh commented Mar 31, 2019

I checked your repository also but still same problem is coming..
what i have to do?
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\VENKAT\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2602, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

then it's weird bcoz I test it then upload it. so installed all the latest version of a module then try it on python 3
pip install opencv-python
pip install pytest-shutil
pip install pandas
pip install pillow
hope it works

i am getting the same error
Is it necessary to run the setup.py ???

i didnt because i already have all the modules required in train.py

@mayurkadampro
Copy link

I checked your repository also but still same problem is coming..
what i have to do?
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\VENKAT\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2602, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

then it's weird bcoz I test it then upload it. so installed all the latest version of a module then try it on python 3
pip install opencv-python
pip install pytest-shutil
pip install pandas
pip install pillow
hope it works

i am getting the same error
Is it necessary to run the setup.py ???

i didnt because i already have all the modules required in train.py

nope, it is not necessary you can directly run by running train.py file
lastly, i can say create virtual env with python 3.5 version and install all req module which is knowing you very well and try to run...

@kraverkar17
Copy link

kraverkar17 commented Apr 1, 2019

showing unknown to every tracked image?
what to do?

@nonokh
Copy link

nonokh commented Apr 1, 2019

I checked your repository also but still same problem is coming..
what i have to do?
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\VENKAT\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2602, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

then it's weird bcoz I test it then upload it. so installed all the latest version of a module then try it on python 3
pip install opencv-python
pip install pytest-shutil
pip install pandas
pip install pillow
hope it works

i am getting the same error
Is it necessary to run the setup.py ???
i didnt because i already have all the modules required in train.py

nope, it is not necessary you can directly run by running train.py file
lastly, i can say create virtual env with python 3.5 version and install all req module which is knowing you very well and try to run...

WORKING!!!!!.
okay i didnt use venv n all but yeah made a few changes. i cloned your repo but your code was getting stuck while taking images and the images wasnt being saved in the folder. i replaced your takeimage() function by the takeimage() from the master repo(ashish). EVERYTHING IS WORKING NOW but still would suggest some changes in the project (i m not that good in python lol):

-- instead of saving a new csv file for each timestamp, it will be better to have a single csv file for each day (eg: Attendace_01_04_2019) and append the recognized faces id and names in the csv file .
so the csv file will contain a list of student who came that day. if the file is already there, ignore it else create new one

Disadvantage of current project: creating multiple csv files every time you run.

@mayurkadampro
Copy link

mayurkadampro commented Apr 1, 2019

I checked your repository also but still same problem is coming..
what i have to do?
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\VENKAT\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2602, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

then it's weird bcoz I test it then upload it. so installed all the latest version of a module then try it on python 3
pip install opencv-python
pip install pytest-shutil
pip install pandas
pip install pillow
hope it works

i am getting the same error
Is it necessary to run the setup.py ???
i didnt because i already have all the modules required in train.py

nope, it is not necessary you can directly run by running train.py file
lastly, i can say create virtual env with python 3.5 version and install all req module which is knowing you very well and try to run...

WORKING!!!!!.
okay i didnt use venv n all but yeah made a few changes. i cloned your repo but your code was getting stuck while taking images and the images wasnt being saved in the folder. i replaced your takeimage() function by the takeimage() from the master repo(ashish). EVERYTHING IS WORKING NOW but still would suggest some changes in the project (i m not that good in python lol):

-- instead of saving a new csv file for each timestamp, it will be better to have a single csv file for each day (eg: Attendace_01_04_2019) and append the recognized faces id and names in the csv file .
so the csv file will contain a list of student who came that day. if the file is already there, ignore it else create new one

Disadvantage of current project: creating multiple csv files every time you run.

I'm glad to know finally its working and yes you can change it to same csv file all you need to store the first created csv file name and append newly created data into it...
refer the same code where all Student names store in StudentDetail.csv file

@kraverkar17
Copy link

Screenshot (1)

in if statement of line 176 I've changed a bit because with previous statement the window was getting stuck with the error mentioned above.....and no error is their but when tracking the image it is showing unknown all the time......

@nonokh
Copy link

nonokh commented Apr 1, 2019

Screenshot (1)

in if statement of line 176 I've changed a bit because with previous statement the window was getting stuck with the error mentioned above.....and no error is their but when tracking the image it is showing unknown all the time......

maybe it is not passing the if() condition you have just changed.
i am guessing something to do with the 'Id'.

did you try this forked repo?
https://github.com/mayurkadampro/Face-Recognition-Based-Attendance-System

give this a try and see if it works. it worked for me

@kraverkar17
Copy link

Screenshot (1)
in if statement of line 176 I've changed a bit because with previous statement the window was getting stuck with the error mentioned above.....and no error is their but when tracking the image it is showing unknown all the time......

maybe it is not passing the if() condition you have just changed.
i am guessing something to do with the 'Id'.

did you try this forked repo?
https://github.com/mayurkadampro/Face-Recognition-Based-Attendance-System

give this a try and see if it works. it worked for me

not working.......window is stucking and the following error is showing though I have installed all the moduls which r required

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\VENKAT\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\core\indexes\base.py", line 2602, in get_loc
return self._engine.get_loc(key)
File "pandas_libs\index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

@tanejasarthak
Copy link

Not Working.
Exception in Tkinter callback
Traceback (most recent call last):
File "/home/sarthak/Downloads/desktop/lib/python3.7/tkinter/init.py", line 1702, in call
return self.func(*args)
File "train.py", line 154, in TrainImages
recognizer = cv2.face.LBPHFaceRecognizer_create()#$cv2.createLBPHFaceRecognizer()
AttributeError: module 'cv2.cv2' has no attribute 'face'

@mayurkadampro
Copy link

Not Working.
Exception in Tkinter callback
Traceback (most recent call last):
File "/home/sarthak/Downloads/desktop/lib/python3.7/tkinter/init.py", line 1702, in call
return self.func(*args)
File "train.py", line 154, in TrainImages
recognizer = cv2.face.LBPHFaceRecognizer_create()#$cv2.createLBPHFaceRecognizer()
AttributeError: module 'cv2.cv2' has no attribute 'face'

replace cv2.face.LBPHFaceRecognizer_create() with cv2.createLBPHFaceRecognizer() and test it again

@nonokh
Copy link

nonokh commented Apr 2, 2019

Not Working.
Exception in Tkinter callback
Traceback (most recent call last):
File "/home/sarthak/Downloads/desktop/lib/python3.7/tkinter/init.py", line 1702, in call
return self.func(*args)
File "train.py", line 154, in TrainImages
recognizer = cv2.face.LBPHFaceRecognizer_create()#$cv2.createLBPHFaceRecognizer()
AttributeError: module 'cv2.cv2' has no attribute 'face'

u are missing components of Opencv.
Try
sudo apt install opencv-contrib-python

then run the code again.

Also, you can try the workaround mentioned by mayurkadampro too.

@divyasri456
Copy link
Author

not working
image

@nonokh
Copy link

nonokh commented Apr 9, 2019

not working
image

Try these:

replace cv2.createLBPHFaceRecognizer() with cv2.face.LBPHFaceRecognizer_create() on line 154

next install other components of opencv

sudo apt install opencv-contrib-python

then run the code again.

@syarwani03
Copy link

module 'cv2.cv2' has no attribute 'face_LBPHFaceRecognizer'

I made changes in that train.py file you can check out from pull request else check out forked repo in my profile and now it's working fine.

i'm sorry,, i still facing this error. where changes u talk about? please make it clear. thank u

@shivapasupuleti
Copy link

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\pc\AppData\Local\Programs\Python\Python37\lib\tkinter_init_.py", line 1705, in call
return self.func(*args)
File "C:\Users\pc\Downloads\Face-Recognition-Based-Attendance-System-master\train.py", line 161, in TrainImages
recognizer = cv2.face_LBPHFaceRecognizer.create()#recognizer = cv2.face.LBPHFaceRecognizer_create()#$cv2.createLBPHFaceRecognizer()
AttributeError: module 'cv2.cv2' has no attribute 'face_LBPHFaceRecognizer'

@janny-sins
Copy link

janny-sins commented May 30, 2021

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Claire\AppData\Roaming\Python\Python36\site-packages\pandas\core\indexes\base.py", line 2898, in get_loc
return self._engine.get_loc(casted_key)
File "pandas_libs\index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
File "pandas_libs\hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas_libs\hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Program Files\Python36\lib\tkinter_init_.py", line 1702, in call
return self.func(*args)
File "C:\Users\Claire\Desktop\New folder (6)\login-verification-master\run.py", line 161, in login_submit
TrackImages(a)
File "C:\Users\Claire\Desktop\New folder (6)\login-verification-master\run.py", line 135, in TrackImages
aa=df.loc[df['Id'] == Id]['Name'].values
File "C:\Users\Claire\AppData\Roaming\Python\Python36\site-packages\pandas\core\frame.py", line 2906, in getitem
indexer = self.columns.get_loc(key)
File "C:\Users\Claire\AppData\Roaming\Python\Python36\site-packages\pandas\core\indexes\base.py", line 2900, in get_loc
raise KeyError(key) from err
KeyError: 'Id'

please help me with this one too.

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

9 participants