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

Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sampl #1

Open
Sudarshan-gurav opened this issue May 3, 2019 · 7 comments

Comments

@Sudarshan-gurav
Copy link

Sudarshan-gurav commented May 3, 2019

from 10 folders only one folder data will extracted

@SuperKogito
Copy link
Owner

Can you please provide a more detailed description of the issue?

@xandyxor
Copy link

xandyxor commented Oct 1, 2019

same issue
TrainingData\f0001\f0001_us_f0001_00294.wav
Traceback (most recent call last):
File "Code/ModelsTrainer.py", line 57, in
gmm.fit(features)
File "D:\project\KAROS\speaker\Voice-based-speaker-identification\venv\lib\site-packages\sklearn\mixture\gmm.py", line 602, in fit
self._fit(X, y)
File "D:\project\KAROS\speaker\Voice-based-speaker-identification\venv\lib\site-packages\sklearn\mixture\gmm.py", line 479, in _fit
estimator=self)
File "D:\project\KAROS\speaker\Voice-based-speaker-identification\venv\lib\site-packages\sklearn\utils\validation.py", line 441, in check_array
"if it contains a single sample.".format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.

(venv) λ pip list
Package Version


cycler 0.10.0
joblib 0.14.0
kiwisolver 1.1.0
matplotlib 3.1.1
numpy 1.17.2
pip 19.2.3
pyparsing 2.4.2
python-dateutil 2.8.0
python-speech-features 0.6
scikit-learn 0.19.1
scipy 1.3.1
setuptools 41.2.0
six 1.12.0
wheel 0.33.6

@manitbaser
Copy link

Solution:
Add the next line before the 'for files in file_paths:' line in ModelsTrainer.py
file_paths = file_paths[1:]

It fixed the issue for me.

@Puru35
Copy link

Puru35 commented Apr 30, 2021

@manitbaser I am Still getting the same error as @xandyxor. Is there anything else I am missing? I would also like to know why this error is occurring. Thanks

@manitbaser
Copy link

@manitbaser I am Still getting the same error as @xandyxor. Is there anything else I am missing? I would also like to know why this error is occurring. Thanks

Follow this branch (Fixed_errors_in_ModelsTrainer): https://github.com/manitbaser/Voice-Based-Speaker-Identification

Install python_speech_features and ffmpeg, and other dependencies, if any. Let me know if there is any other issue. ✌🏻

@Puru35
Copy link

Puru35 commented May 2, 2021

@manitbaser I'm getting 'sed' is not recognized as an internal or external command,
operable program or batch file.
as an error. the problem happens to be in SilenceEliminator.py. I've downloaded the files from http://gnuwin32.sourceforge.net/install.html and installed it at C:\Program Files (x86)\GnuWin32. Still the same error. Would love it if you could help me out. Thanks again!!

@manitbaser
Copy link

You downloaded and installed ‘sed’ from GnuWin32, but it’s just not on your path. You need to run in a terminal where C:\Program Files (x86)\GnuWin32 is added to PATH. You might also benefit from installing ‘which’, and then you can have a sanity check with which sed.

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

5 participants