-
Notifications
You must be signed in to change notification settings - Fork 241
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
ValueError: Array contains NaN or infinity. #4
Comments
It might be helpful to update or reinstall the sklearn package. pip install -U scikit-learn My version is scikit-learn==0.17.1. From the source code here, there seems to be no sklearn/metrics/metrics.py. |
@Cysu It worked! thanks. |
@blasheroy Could you please check the output of the following commands?
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I run the following codes using the download models.
python2 tools/test_net.py --gpu 0
--gallery_def models/psdb/VGG16/test_gallery.prototxt
--probe_def models/psdb/VGG16/test_probe.prototxt
--net output/psdb_train/VGG16_iter_100000.caffemodel
--cfg experiments/cfgs/train.yml
--imdb psdb_test
It shows that
/usr/lib/python2.7/dist-packages/sklearn/metrics/metrics.py:599: RuntimeWarning: invalid value encountered in true_divide
recall = tps / tps[-1]
Traceback (most recent call last):
File "/home/duan/person_search-master/tools/test_net.py", line 218, in
evaluate(protoc, imdb.image_index, output_dir, args.gallery_size == 0)
File "/home/duan/person_search-master/tools/test_net.py", line 111, in evaluate
ap = average_precision_score(y_true, y_score) * recall_rate
File "/usr/lib/python2.7/dist-packages/sklearn/metrics/metrics.py", line 314, in average_precision_score
return auc(recall, precision)
File "/usr/lib/python2.7/dist-packages/sklearn/metrics/metrics.py", line 172, in auc
x, y = check_arrays(x, y)
File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 233, in check_arrays
_assert_all_finite(array)
File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 27, in _assert_all_finite
raise ValueError("Array contains NaN or infinity.")
ValueError: Array contains NaN or infinity.
thanks~
The text was updated successfully, but these errors were encountered: