KlugerLab / FIt-SNE

Fast Fourier Transform-accelerated Interpolation-based t-SNE (FIt-SNE)
Other
593 stars 108 forks source link

Error about dimension #83

Closed zhaixzh closed 4 years ago

zhaixzh commented 4 years ago

When I running the test.ipynb,I encounter an error

ValueError: 'c' argument has 70000 elements, which is not acceptable for use with 'x' with size 25000, 'y' with size 25000.

Then I run another data,I encounter the same error, no matter how much cell number from the initial data,after fast_tsne,the Z.shape is (25000,50)

dkobak commented 4 years ago

Where exactly in test.ipynb do you get this error? The first time tsne is run? Please copy paste the terminal output.

zhaixzh commented 4 years ago

# Running t-SNE on the full MNIST in the default way (this uses perplexity=30) %time Z = fast_tsne(X50, seed=42) plt.figure(figsize=(5,5)) plt.scatter(Z[:,0], Z[:,1], c=col[y], s=.1) plt.tight_layout()

When I test this step,I encounter this error. I use this test data and anthoer data,but after fast_tsne,the 'Z' is the same,should I add some parameters. Thank you .

dkobak commented 4 years ago

Please post the terminal output here. Open the terminal window where you started the Python notebook and copy-paste the FIt-SNE output.

zhaixzh commented 4 years ago

`--------------------------------------------------------------------------- ValueError Traceback (most recent call last) ~/.conda/envs/vev1/lib/python3.7/site-packages/matplotlib/axes/_axes.py in _parse_scatter_color_args(c, edgecolors, kwargs, xshape, yshape, get_next_color_func) 4290 valid_shape = False -> 4291 raise ValueError 4292 except ValueError:

ValueError:

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)

in 4 5 plt.figure(figsize=(5,5)) ----> 6 plt.scatter(Z[:,0], Z[:,1], c=col[y], s=.1) 7 plt.tight_layout() ~/.conda/envs/vev1/lib/python3.7/site-packages/matplotlib/pyplot.py in scatter(x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, plotnonfinite, data, **kwargs) 2845 verts=verts, edgecolors=edgecolors, 2846 plotnonfinite=plotnonfinite, **({"data": data} if data is not -> 2847 None else {}), **kwargs) 2848 sci(__ret) 2849 return __ret ~/.conda/envs/vev1/lib/python3.7/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs) 1599 def inner(ax, *args, data=None, **kwargs): 1600 if data is None: -> 1601 return func(ax, *map(sanitize_sequence, args), **kwargs) 1602 1603 bound = new_sig.bind(ax, *args, **kwargs) ~/.conda/envs/vev1/lib/python3.7/site-packages/matplotlib/axes/_axes.py in scatter(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, plotnonfinite, **kwargs) 4452 self._parse_scatter_color_args( 4453 c, edgecolors, kwargs, xshape, yshape, -> 4454 get_next_color_func=self._get_patches_for_fill.get_next_color) 4455 4456 if plotnonfinite and colors is None: ~/.conda/envs/vev1/lib/python3.7/site-packages/matplotlib/axes/_axes.py in _parse_scatter_color_args(c, edgecolors, kwargs, xshape, yshape, get_next_color_func) 4296 "acceptable for use with 'x' with size {xs}, " 4297 "'y' with size {ys}." -> 4298 .format(nc=n_elem, xs=xsize, ys=ysize) 4299 ) 4300 else: ValueError: 'c' argument has 70000 elements, which is not acceptable for use with 'x' with size 25000, 'y' with size 25000.`
dkobak commented 4 years ago

No, sorry, that's not what I meant. I need to see the FIt-SNE output. It should look like this:

=============== t-SNE v1.1.0 ===============
fast_tsne data_path: data.dat
fast_tsne result_path: result.dat
fast_tsne nthreads: 8
Read the following parameters:
...

and quite a lot afterwards.

What you copied are Python errors when running plt.scatter. What I need, is Python output when running fast_tsne.

zhaixzh commented 4 years ago

I have solved the problem. I changed the terminal, then normal running, it should be configuration problem. Thank you .