David Lee
David Lee

Reputation: 21

installed face_recognition, but cannot import. (Python3.64)

>>> import face_recognition
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/username/Desktop/face_recognition_low/face_recognition.py", line 30, in <module>
    np.set_printoptions(threshold=np.nan)
  File "/Users/username/.virtualenvs/cv/lib/python3.6/site-packages/numpy/core/arrayprint.py", line 246, in set_printoptions
    floatmode, legacy)
  File "/Users/username/.virtualenvs/cv/lib/python3.6/site-packages/numpy/core/arrayprint.py", line 93, in _make_options_dict
    raise ValueError("threshold must be numeric and non-NAN, try "
ValueError: threshold must be numeric and non-NAN, try sys.maxsize for untruncated representation

There was no problem importing face_recognition yesterday but all of sudden it does not work. I have no idea how to fix this problem... Any assistance would be highly appreciated.

I restarted my mac and tried again now it works fine. I would like to figure out why...

>>> import dlib
>>> import face_recognition 
>>>

Upvotes: 1

Views: 3319

Answers (1)

赵舶彤
赵舶彤

Reputation: 51

Please import sys by import sys.

Then replace

np.set_printoptions(threshold=np.nan)

with

np.set_printoptions(threshold=sys.maxsize)

Upvotes: 5

Related Questions