CNN-for-single-channel-speech-enhancement icon indicating copy to clipboard operation
CNN-for-single-channel-speech-enhancement copied to clipboard

SENN_train cannot run

Open Franky0620 opened this issue 6 years ago • 11 comments

I set the Path of data, but it has the problem on " images, targets = SE_Net.inputs(data_frames)"

Franky0620 avatar Oct 16 '19 09:10 Franky0620

Hello, I have the same problem as you. How do you solve it?

Huer-H avatar Oct 18 '19 02:10 Huer-H

I think it is caused by different versions of python and its dependencies. You should check the error details to get that working on your versions of software

zhr1201 avatar Oct 18 '19 02:10 zhr1201

I think it is caused by different versions of python and its dependencies. You should check the error details to get that working on your versions of software

I test on Python 3.7 3.6 3.5, while, not working . The issue is happed on SENN.py, for i in range(0, self.batch_size, 1)])....

Franky0620 avatar Oct 18 '19 02:10 Franky0620

Hello, I have the same problem as you. How do you solve it?

still not working....

Franky0620 avatar Oct 18 '19 02:10 Franky0620

Please please please read the error message carefully otherwise you are not moving in the right direction

zhr1201 avatar Oct 18 '19 03:10 zhr1201

targets = tf.concat(0,[tf.reshape(speech_f[i][self.N_IN - 1][0:self.NEFF],[1, self.NEFF]) for i in range(0, self.batch_size, 1)]) There is a problem with this part of the code (senn.py) ----ValueError: Shapes (20, 1, 129) and () are incompatible--- 20 is batch_size

Huer-H avatar Oct 21 '19 02:10 Huer-H

I have modified this part of the code

targets = tf.concat(0,[tf.reshape(speech_f[i][self.N_IN - 1][0:self.NEFF],[1, self.NEFF]) for i in range(0, self.batch_size, 1)])------------------------> targets = tf.concat([tf.reshape(speech_f[i][self.N_IN - 1][0:self.NEFF],[1, self.NEFF]) for i in range(0, self.batch_size, 1)],0)

The error message is now gone

Huer-H avatar Oct 21 '19 02:10 Huer-H

@JH2018-2021 Thx! Could you please list your tf version so that other people with the same version of tensorflow can refer to this issue to solve their problems.

zhr1201 avatar Oct 21 '19 03:10 zhr1201

@JYH9351 May I ask which version of tensorflow are you using?

Luciferhy avatar Feb 25 '20 13:02 Luciferhy

/usr/local/lib/python2.7/dist-packages/librosa/init.py:35: FutureWarning: You are using librosa with Python 2. Please note that librosa 0.7 will be the last version to support Python 2, after which it will require Python 3 or later. FutureWarning) 11572 speech found 11572 noise found 824 speech found 824 noise found Traceback (most recent call last): File "SENN_train.py", line 191, in train() File "SENN_train.py", line 122, in train sess.run(init) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 717, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 915, in _run feed_dict_string, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 965, in _do_run target_list, options, run_metadata) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 985, in _do_call raise type(e)(node_def, op, message) InvalidArgumentError: No OpKernel was registered to support Op 'FFT' with these attrs. Registered kernels:

     [[Node: FFT_1 = FFT[](Cast_1)]]

Caused by op u'FFT_1', defined at: File "SENN_train.py", line 191, in train() File "SENN_train.py", line 105, in train images, targets = SE_Net.inputs(data_frames) File "SENN.py", line 98, in inputs speech_f0 = tf.fft(tf.cast(raw_speech, tf.complex64)) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_math_ops.py", line 798, in fft result = _op_def_lib.apply_op("FFT", input=input, name=name) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 749, in apply_op op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2380, in create_op original_op=self._default_original_op, op_def=op_def) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1298, in init self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'FFT' with these attrs. Registered kernels:

     [[Node: FFT_1 = FFT[](Cast_1)]]

我遇到一个这个问题,查了一下是由于CPU版上没有FFT操作对象之类的,请问是必须要在GPU上运行吗? @zhr1201

Luciferhy avatar Feb 25 '20 13:02 Luciferhy

@Luciferhy 你这个问题解决了吗?我也遇到同样的问题。

Lerry123 avatar Apr 22 '20 18:04 Lerry123