输入包含NaN,无穷大或Django项目上的dtype('float64')太大的值

时间:2019-11-05 20:04:55

标签: python django scikit-learn python-3.6 face-recognition

我尝试了https://github.com/samarth-p/Face_recognition此仓库。我不能使用识别功能

使用Jatson Nano在Ubuntu 18.04上工作。使用Python3,我尝试了virtualenv

Internal Server Error: /identify/
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py                                             ", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py", li                                             ne 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py", li                                             ne 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/spoofer/kurulum/app/views.py", line 180, in identify
    identify_faces(video_capture)
  File "/home/spoofer/kurulum/app/views.py", line 94, in identify_faces
    predictions = predict(rgb_frame, model_path="app/facerec/models/trained_mode                                             l.clf")
  File "/home/spoofer/kurulum/app/views.py", line 66, in predict
    closest_distances = knn_clf.kneighbors(faces_encodings, n_neighbors=1)
  File "/usr/local/lib/python3.6/dist-packages/sklearn/neighbors/base.py", line                                              402, in kneighbors
    X = check_array(X, accept_sparse='csr')
  File "/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py", lin                                             e 542, in check_array
    allow_nan=force_all_finite == 'allow-nan')
  File "/usr/local/lib/python3.6/dist-packages/sklearn/utils/validation.py", lin                                             e 56, in _assert_all_finite
    raise ValueError(msg_err.format(type_err, X.dtype))
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').

0 个答案:

没有答案