keunwoochoi / transfer_learning_music

Transfer learning for music classification and regression tasks
256 stars 60 forks source link

Error While Running easy_feature_extraction.py #7

Closed DAKSHSEMWAL closed 6 years ago

DAKSHSEMWAL commented 6 years ago

Can You Please Help: Traceback (most recent call last): File "easy_feature_extraction.py", line 105, in main(txt_path, out_path, n_jobs) File "easy_feature_extraction.py", line 73, in main models = [load_model(mid_idx) for mid_idx in range(5)] # for five models... File "easy_feature_extraction.py", line 27, in load_model model = build_convnet_model(args, last_layer=False) File "I:\Coding\transfer_learning_music-master\models_transfer.py", line 35, in build_convnet_model last_layer=last_layer, sr=sr) File "I:\Coding\transfer_learning_music-master\models_transfer.py", line 79, in raw_vgg name='melgram')) File "C:\Users\dsemw\vr2\lib\site-packages\kapre-0.1.2.1-py2.7.egg\kapre\time_frequency.py", line 256, in init super(Melspectrogram, self).init(**kwargs) File "C:\Users\dsemw\vr2\lib\site-packages\kapre-0.1.2.1-py2.7.egg\kapre\time_frequency.py", line 86, in init self.image_data_format = K.image_data_format() AttributeError: 'module' object has no attribute 'image_data_format'

the pip packagers I have installed are appdirs (1.4.3) audioread (2.1.5) cycler (0.10.0) Cython (0.25.2) decorator (4.2.1) enum34 (1.1.6) ffmpy (0.2.2) funcsigs (1.0.2) functools32 (3.2.3.post2) future (0.16.0) h5py (2.7.0) joblib (0.11) kapre (0.1.2.1) Keras (1.2.2) librosa (0.5.1) llvmlite (0.21.0) matplotlib (2.0.0) mistune (0.8.3) numba (0.36.2) numpy (1.14.0) packaging (16.8) pandas (0.22.0) pip (9.0.1) pyparsing (2.2.0) python-dateutil (2.6.1) pytz (2018.3) PyYAML (3.12) resampy (0.2.0) scikit-learn (0.19.1) scipy (1.0.0) setuptools (38.5.1) singledispatch (3.4.0.3) six (1.11.0) subprocess32 (3.2.7) Theano (1.0.1)

DAKSHSEMWAL commented 6 years ago

Keras.jason reads as follows { "floatx": "float32", "epsilon": 1e-07, "backend": "theano", "image_data_format": "channels_last", "image_dim_odering": "th"

}

keunwoochoi commented 6 years ago

Yes. Please use keras 2.x. (and read readme!)

On 13 Feb 2018, at 06:48, DAKSH SEMWAL notifications@github.com<mailto:notifications@github.com> wrote:

Can You Please Help: Traceback (most recent call last): File "easy_feature_extraction.py", line 105, in main(txt_path, out_path, n_jobs) File "easy_feature_extraction.py", line 73, in main models = [load_model(mid_idx) for mid_idx in range(5)] # for five models... File "easy_feature_extraction.py", line 27, in load_model model = build_convnet_model(args, last_layer=False) File "I:\Coding\transfer_learning_music-master\models_transfer.py", line 35, in build_convnet_model last_layer=last_layer, sr=sr) File "I:\Coding\transfer_learning_music-master\models_transfer.py", line 79, in raw_vgg name='melgram')) File "C:\Users\dsemw\vr2\lib\site-packages\kapre-0.1.2.1-py2.7.egg\kapre\time_frequency.py", line 256, in init super(Melspectrogram, self).init(**kwargs) File "C:\Users\dsemw\vr2\lib\site-packages\kapre-0.1.2.1-py2.7.egg\kapre\time_frequency.py", line 86, in init self.image_data_format = K.image_data_format() AttributeError: 'module' object has no attribute 'image_data_format'

the pip packagers I have installed are appdirs (1.4.3) audioread (2.1.5) cycler (0.10.0) Cython (0.25.2) decorator (4.2.1) enum34 (1.1.6) ffmpy (0.2.2) funcsigs (1.0.2) functools32 (3.2.3.post2) future (0.16.0) h5py (2.7.0) joblib (0.11) kapre (0.1.2.1) Keras (1.2.2) librosa (0.5.1) llvmlite (0.21.0) matplotlib (2.0.0) mistune (0.8.3) numba (0.36.2) numpy (1.14.0) packaging (16.8) pandas (0.22.0) pip (9.0.1) pyparsing (2.2.0) python-dateutil (2.6.1) pytz (2018.3) PyYAML (3.12) resampy (0.2.0) scikit-learn (0.19.1) scipy (1.0.0) setuptools (38.5.1) singledispatch (3.4.0.3) six (1.11.0) subprocess32 (3.2.7) Theano (1.0.1)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/keunwoochoi/transfer_learning_music/issues/7, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APZ8xYXtFF6eVzWl4Ay5QKMg_OgNVVcoks5tUTBDgaJpZM4SDSm7.

DAKSHSEMWAL commented 6 years ago

After upgrading Keras and running the command I received this

(vr2) I:\Coding\transfer_learning_music-master>pip install --upgrade keras Collecting keras Using cached Keras-2.1.3-py2.py3-none-any.whl Requirement already up-to-date: pyyaml in c:\users\dsemw\vr2\lib\site-packages (from keras) Requirement already up-to-date: six>=1.9.0 in c:\users\dsemw\vr2\lib\site-packages (from keras) Requirement already up-to-date: scipy>=0.14 in c:\users\dsemw\vr2\lib\site-packages (from keras) Requirement already up-to-date: numpy>=1.9.1 in c:\users\dsemw\vr2\lib\site-packages (from keras) Installing collected packages: keras Found existing installation: Keras 1.2.2 Uninstalling Keras-1.2.2: Successfully uninstalled Keras-1.2.2 Successfully installed keras-2.1.3

(vr2) I:\Coding\transfer_learning_music-master>python easy_feature_extraction.py audio_paths.txt features.npy 16 C:\Users\dsemw\vr2\lib\site-packages\h5py__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Using Theano backend. WARNING (theano.configdefaults): g++ not available, if using conda: conda install m2w64-toolchain C:\Users\dsemw\vr2\lib\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory warnings.warn("DeprecationWarning: there is no c++ compiler." WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string. WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions. Traceback (most recent call last): File "easy_feature_extraction.py", line 17, in raise RuntimeError('Keras version should be 1.x, maybe 1.2.2') RuntimeError: Keras version should be 1.x, maybe 1.2.2

keunwoochoi commented 6 years ago

As you might be easily able to get if you read them, they all seem Theano issues and not about Kapre or my code. Please google the messages.

On 13 Feb 2018, at 06:52, DAKSH SEMWAL notifications@github.com<mailto:notifications@github.com> wrote:

After upgrading Keras and running the command I received this

(vr2) I:\Coding\transfer_learning_music-master>pip install --upgrade keras Collecting keras Using cached Keras-2.1.3-py2.py3-none-any.whl Requirement already up-to-date: pyyaml in c:\users\dsemw\vr2\lib\site-packages (from keras) Requirement already up-to-date: six>=1.9.0 in c:\users\dsemw\vr2\lib\site-packages (from keras) Requirement already up-to-date: scipy>=0.14 in c:\users\dsemw\vr2\lib\site-packages (from keras) Requirement already up-to-date: numpy>=1.9.1 in c:\users\dsemw\vr2\lib\site-packages (from keras) Installing collected packages: keras Found existing installation: Keras 1.2.2 Uninstalling Keras-1.2.2: Successfully uninstalled Keras-1.2.2 Successfully installed keras-2.1.3

(vr2) I:\Coding\transfer_learning_music-master>python easy_feature_extraction.py audio_paths.txt features.npy 16 C:\Users\dsemw\vr2\lib\site-packages\h5pyinit.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Using Theano backend. WARNING (theano.configdefaults): g++ not available, if using conda: conda install m2w64-toolchain C:\Users\dsemw\vr2\lib\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory warnings.warn("DeprecationWarning: there is no c++ compiler." WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string. WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions. Traceback (most recent call last): File "easy_feature_extraction.py", line 17, in raise RuntimeError('Keras version should be 1.x, maybe 1.2.2') RuntimeError: Keras version should be 1.x, maybe 1.2.2

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/keunwoochoi/transfer_learning_music/issues/7#issuecomment-365167882, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APZ8xZJ8bdQ4vO05k45LG-oOGbd7JQeBks5tUTE9gaJpZM4SDSm7.

DAKSHSEMWAL commented 6 years ago

while running "easy_feature_extraction.py" my terminal got stuck at this point is this normal screenshot 2

keunwoochoi commented 6 years ago

I can’t really spot the problem exactly. What’s the difference of the file particularly? Is it too short for example?

On 28Feb 2018, at 11:23, DAKSH SEMWAL notifications@github.com<mailto:notifications@github.com> wrote:

while running "easy_feature_extraction.py" my terminal got stuck at this point is this normal [screenshot 2]https://user-images.githubusercontent.com/14074454/36785066-a2928a42-1ca7-11e8-897d-c8a178a166f2.png

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/keunwoochoi/transfer_learning_music/issues/7#issuecomment-369209935, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APZ8xYfMiItzTuFSwDXgdN2XG4WNLZaYks5tZTdIgaJpZM4SDSm7.