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: perplexity must be less than n_samples #7

Closed
yogurt-shadow opened this issue Apr 11, 2024 · 0 comments
Closed

ValueError: perplexity must be less than n_samples #7

yogurt-shadow opened this issue Apr 11, 2024 · 0 comments

Comments

@yogurt-shadow
Copy link

I have tried to run the code with command python3 RNN_train.py -JI exp_config_getting_started.json
but got an error below

Traceback (most recent call last):
  File "/home/wangzh/Ropey/RNN_train.py", line 102, in <module>
    plot_tsne(model, vocabs[0], model_path, "RN")
  File "/home/wangzh/Ropey/RNN_eval.py", line 88, in plot_tsne
    tsne_proj = tsne.fit_transform(emb_w)
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wangzh/miniconda3/lib/python3.11/site-packages/sklearn/utils/_set_output.py", line 295, in wrapped
    data_to_wrap = f(self, X, *args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wangzh/miniconda3/lib/python3.11/site-packages/sklearn/base.py", line 1474, in wrapper
    return fit_method(estimator, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wangzh/miniconda3/lib/python3.11/site-packages/sklearn/manifold/_t_sne.py", line 1135, in fit_transform
    self._check_params_vs_input(X)
  File "/home/wangzh/miniconda3/lib/python3.11/site-packages/sklearn/manifold/_t_sne.py", line 846, in _check_params_vs_input
    raise ValueError("perplexity must be less than n_samples")
ValueError: perplexity must be less than n_samples

This seems some bugs in sklearn or tmplot or modisco, as the same issue posted on maximtrp/tmplot#6 and kundajelab/tfmodisco#112

However, reinstall tmplot==0.1.2 or modisco==0.5.16.4.1 doesn't work.

I think it will help a lot if the package version is suggested in requirements.txt.

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

1 participant