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

cannot reshape array of size 28800 into shape (480,10) #389

Open
ohpage opened this issue Jul 28, 2023 · 1 comment
Open

cannot reshape array of size 28800 into shape (480,10) #389

ohpage opened this issue Jul 28, 2023 · 1 comment

Comments

@ohpage
Copy link

ohpage commented Jul 28, 2023

details as below

ValueError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_5940\2340920530.py in
4 if os.path.isdir(f'{test}{directory}'):
5 features, files, f_names = dir_feat_extract(f'{test}{directory}', 0.2, 0.2,
----> 6 0.1, 0.1, 1)
7 feature_list = np.append(feature_list, features.reshape(-1,138), axis=0)
8 file_list = file_list + files

~\AppData\Local\Temp\ipykernel_5940\3681827919.py in dir_feat_extract(folder_path, mid_window, mid_step, short_window, short_step, duration, compute_beat)
53 round(mid_step * sampling_rate),
54 round(sampling_rate * short_window),
---> 55 round(sampling_rate * short_step))
56 beat, beat_conf = MidTermFeatures.beat_extraction(short_features, short_step)
57 else:

d:\ProgramData\Anaconda3\lib\site-packages\pyAudioAnalysis\MidTermFeatures.py in mid_feature_extraction(signal, sampling_rate, mid_window, mid_step, short_window, short_step)
93 short_features, short_feature_names =
94 ShortTermFeatures.feature_extraction(signal, sampling_rate,
---> 95 short_window, short_step)
96
97 n_stats = 2

d:\ProgramData\Anaconda3\lib\site-packages\pyAudioAnalysis\ShortTermFeatures.py in feature_extraction(signal, sampling_rate, window, step, deltas)
633
634 # short-term entropy of energy
--> 635 feature_vector[2] = energy_entropy(x)
636
637 # sp centroid/spread

d:\ProgramData\Anaconda3\lib\site-packages\pyAudioAnalysis\ShortTermFeatures.py in energy_entropy(frame, n_short_blocks)
42
43 # sub_wins is of size [n_short_blocks x L]
---> 44 sub_wins = frame.reshape(sub_win_len, n_short_blocks, order='F').copy()
45
46 # Compute normalized sub-frame energies:

ValueError: cannot reshape array of size 28800 into shape (480,10)

@ohpage
Copy link
Author

ohpage commented Jul 28, 2023

I solved
when i changed directory_feature_extract func(to dir_feat_extract), set new variable 'duration', already used in func.

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