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

Errors using scripts/tSNE-audio.py #49

Open
FunctionalJerk opened this issue Oct 29, 2023 · 0 comments
Open

Errors using scripts/tSNE-audio.py #49

FunctionalJerk opened this issue Oct 29, 2023 · 0 comments

Comments

@FunctionalJerk
Copy link

I was trying to recreate the projects that I realized last year with the help of this script, found several issues and managed to solve them:

In line 42 and line 63 I added the sample rate argument, otherwise librosa.load() defaults to 22050Hz.:

y, sr = librosa.load(source_audio, sr=None)

I also had to change line 69 to:

tsne = TSNE(n_components=tsne_dimensions, learning_rate=200, perplexity=tsne_perplexity, verbose=2, angle=0.1).fit_transform(np.array([f["features"] for f in feature_vectors]))

Before I was getting an Error hinting at the fact that fit_transform isn't given the numpy-array that it expects:

    File ~/.local/lib/python3.10/site-packages/sklearn/manifold/_t_sne.py:821
    if self.perplexity >= X.shape[0]:
    ^
    AttributeError: 'list' object has no attribute 'shape'

I'm on Python 3.10.12, with
librosa==0.10.1
scikit-learn==1.3.2

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