Skip to content
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 must not contain infs or NaNs #1

Open
caseybasichis opened this issue Oct 14, 2016 · 1 comment
Open

ValueError: array must not contain infs or NaNs #1

caseybasichis opened this issue Oct 14, 2016 · 1 comment

Comments

@caseybasichis
Copy link

Hi,

I'm trying to get up and running with this repo but I'm encountering an error.

I tried a suggestion of updating to a new scikit-learn:
pip install --pre scikit-learn -U

Here is the output:

Using TensorFlow backend.
getting activations for BOBBY_SN.jpg 0/1
[t-SNE] Computing pairwise distances...
[t-SNE] Computing 0 nearest neighbors...
[t-SNE] Computed conditional probabilities for sample 1 / 1
[t-SNE] Mean sigma: 1125899906842624.000000
Traceback (most recent call last):
File "main.py", line 33, in
tsne = TSNE(n_components=2, perplexity=30, verbose=2).fit_transform(X)
File "/usr/local/lib/python2.7/site-packages/sklearn/manifold/t_sne.py", line 880, in fit_transform
embedding = self._fit(X)
File "/usr/local/lib/python2.7/site-packages/sklearn/manifold/t_sne.py", line 785, in _fit
skip_num_points=skip_num_points)
File "/usr/local/lib/python2.7/site-packages/sklearn/manifold/t_sne.py", line 838, in _tsne
**opt_args)
File "/usr/local/lib/python2.7/site-packages/sklearn/manifold/t_sne.py", line 388, in _gradient_descent
grad_norm = linalg.norm(grad)
File "/usr/local/lib/python2.7/site-packages/scipy/linalg/misc.py", line 129, in norm
a = np.asarray_chkfinite(a)
File "/usr/local/lib/python2.7/site-packages/numpy/lib/function_base.py", line 1033, in asarray_chkfinite
"array must not contain infs or NaNs")
ValueError: array must not contain infs or NaNs

@genekogan
Copy link
Owner

it appears you only have 1 image you are analyzing. t-SNE needs more data points.

check out the image t-sne guide at https://github.com/ml4a/ml4a-guides for a more precise tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants