Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

maximum recursion depth exceeded #28

Open
antiapt opened this issue Feb 20, 2020 · 6 comments
Open

maximum recursion depth exceeded #28

antiapt opened this issue Feb 20, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@antiapt
Copy link

antiapt commented Feb 20, 2020

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!

@wolterlw
Copy link
Owner

wolterlw commented Feb 20, 2020

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?

@wolterlw wolterlw added the bug Something isn't working label Feb 20, 2020
@antiapt
Copy link
Author

antiapt commented Feb 21, 2020

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!

@antiapt
Copy link
Author

antiapt commented Feb 21, 2020

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.

@wolterlw
Copy link
Owner

better clip the value under exp

@antiapt
Copy link
Author

antiapt commented Feb 21, 2020

Thanks for your suggestion, will try this.

@wolterlw
Copy link
Owner

wolterlw commented Mar 8, 2020

so?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants