hand_tracking
hand_tracking copied to clipboard
maximum recursion depth exceeded
I was following the instructions and trying to reproduce the examples. But it raises a recursion error when calling the sigmoid function here.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\user\Desktop\temp\hand_tracking\hand_tracker.py", line 170, in __call__
source, keypoints = self.detect_hand(img_norm)
File "C:\Users\user\Desktop\temp\hand_tracking\hand_tracker.py", line 125, in detect_hand
detecion_mask = self._sigm(out_clf) > 0.7
File "C:\Users\user\Desktop\temp\hand_tracking\hand_tracker.py", line 95, in _sigm
return 1 / (1 + np.exp(-x) )
RecursionError: maximum recursion depth exceeded while calling a Python object
Any idea of how to deal with this? I am using TensorFlow 2.0, python 35 in virtualenv of anaconda. Much appreciated!
you're on master branch, right? The code doesn't seem to have any recursive calls. Can you run a debugger and set a breakpoint in sigm, step outside of it and see where it locks into recursion?
Yes, I am on the master branch and am stepping into this. It seems like to raise this problem when calculating the out_clf. This value caused the recursion issue when calculating the sigmoid.
But could you share with me your system requirement, thank you!
It seems like there was an overflow error when calculating the exp() function. I converted the out_reg and out_clf into np.longdouble can it works out then.
better clip the value under exp
Thanks for your suggestion, will try this.
so?