Le-Xiaohuai-speech / DPCRN_DNS3

Implementation of paper "DPCRN: Dual-Path Convolution Recurrent Network for Single Channel Speech Enhancement"
186 stars 41 forks source link

python ./real_time_processing/real_time_DPCRN.py报错,您好,请问我这是什么问题呢? #13

Closed leyangxing closed 2 years ago

leyangxing commented 2 years ago

Traceback (most recent call last): File "D:/speech_denoise/DPCRN_DNS3-main/real_time_processing/real_time_DPCRN.py", line 293, in encoder_RT.load_weights('../pretrain_model/model_DPCRN_SNR+logMSE_causal_sinw.h5') File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 182, in load_weights return super(Model, self).load_weights(filepath, by_name) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\engine\network.py", line 1373, in load_weights saving.load_weights_from_hdf5_group(f, self.layers) File "D:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow_core\python\keras\saving\hdf5_format.py", line 645, in load_weights_from_hdf5_group original_keras_version = f.attrs['keras_version'].decode('utf8') AttributeError: 'str' object has no attribute 'decode'

Le-Xiaohuai-speech commented 2 years ago

有可能是keras 版本和tf版本的问题,使用tf 1.14以上,keras就用tf.keras 就好。

lacking1 commented 2 years ago

hdf5

是hdf5的版本匹配问题;不想更换版本的话,就把那行代码改为original_keras_version = f.attrs['keras_version'].encode('utf8').decode('utf8')