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

"negative dimensions are not allowed" error #2

Open
sravanco opened this issue May 15, 2020 · 2 comments
Open

"negative dimensions are not allowed" error #2

sravanco opened this issue May 15, 2020 · 2 comments

Comments

@sravanco
Copy link

Server returns this error for all my WAV files. With the project's test WAV files, its working fine.
I converted the wav files to 41kHz, 16k Bit rate, mono - just like in those test files.
My sample test file: https://www.dropbox.com/s/q1kssodw8dx92f0/test1.wav?dl=0

The server returns with response "ERROR", while the error is "negative dimensions are not allowed"

@Asphelzhn
Copy link

Server returns this error for all my WAV files. With the project's test WAV files, its working fine.
I converted the wav files to 41kHz, 16k Bit rate, mono - just like in those test files.
My sample test file: https://www.dropbox.com/s/q1kssodw8dx92f0/test1.wav?dl=0

The server returns with response "ERROR", while the error is "negative dimensions are not allowed"

I have the same problem as yours. Did you find the solution?Thanks

@Asphelzhn
Copy link

Asphelzhn commented Sep 22, 2020

Server returns this error for all my WAV files. With the project's test WAV files, its working fine.
I converted the wav files to 41kHz, 16k Bit rate, mono - just like in those test files.
My sample test file: https://www.dropbox.com/s/q1kssodw8dx92f0/test1.wav?dl=0

The server returns with response "ERROR", while the error is "negative dimensions are not allowed"

I have found the problem. The dimension of signals could be incompatible with the logmel function in model/utils, so I have changed the dimension into (1600,)and it works.

`
def get_logmel_fb(segment, len_window=25, stride=10, filters=40):
sample_rate = segment.frame_rate
signals = np.array(segment.get_array_of_samples())

#converting to ms
len_window /= 1000
stride /= 1000

if len(signals.shape) != 1:
    signals = signals[:,0] #Getting only the first channel data

if(signals.ndim < 1600):
    signals = np.zeros((1600, ))
print("get_logmel_fb success|" + str(sample_rate) + "|" + str(signals.shape))
feature = speechpy.feature.lmfe(signals,sample_rate,frame_length=len_window,frame_stride=stride,num_filters=filters)
print("feature|"+str(feature))
return feature

`

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