RE-VERB icon indicating copy to clipboard operation
RE-VERB copied to clipboard

"negative dimensions are not allowed" error

Open sravanco opened this issue 4 years ago • 2 comments

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"

sravanco avatar May 15 '20 15:05 sravanco

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 avatar Sep 20 '20 06:09 Asphelzhn

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

`

Asphelzhn avatar Sep 22 '20 03:09 Asphelzhn