Open niwtr opened 5 years ago
Can you print out len(fps)
to see how large it is? I'm not sure but it seems like the script is not finding all of your files.
I am having same issue, Printing the len(fps), it is 860 (My total training examples)
Traceback (most recent call last): File "train_specgan.py", line 760, in <module> moments(fps, args) File "train_specgan.py", line 614, in moments _X_lmags = np.concatenate(_X_lmags, axis=0) File "<__array_function__ internals>", line 6, in concatenate ValueError: need at least one array to concatenate
@hinash88 have you fixed the error?
@hinash88 @sanchita-ghose
So I've been able to generate the moments, but the fact is this code is just not all that viable anymore unless you're running an older (1.x
) version of TF. So here's what I did.
train_specgan.py
tf_upgrade_v2 --infile train_specgan.py --outfile train_specgan_v2.py
This will produce some errors, as the contrib
library no longer exists in tf. So for every instance of contrib
in train_specgan.py
you have to change it from: tf.contrib.signal
to tf.signal
Then because of the way tensorflow works, nothing will actually be done until the session is allowed to run, and because tensorflow switched to eager execution at some point, this session to create the moments will actually never be run, and this is the cause of the need at least one array to concatenate
error. So, the simplest fix is to add the following line at the top of the file:
tf.compat.v1.disable_eager_execution()
I hope this helps. I don't know a lot about tensorflow, as I try to stick to pytorch, so I'm not sure if the changes I've made are in line with the best practices, but it seems to be working for me. If you are stuck in a 1.x
version then I can't help you, I don't think. Best of luck!
@alexanderbarnhill ,
I tried what you have mentioned but I am still getting the error (need at least one array to concatenate).
I am using tensorflow gpu 1.14 Cuda compilation tools, release 10.0, V10.0.130 CUDA Version: 11.0
Hi, there, Tried to generate moments of SpecGAN using script:
python train_specgan.py moments --data_dir ../sc09/train/ ./train
Where '../sc09/train' is a folder containing the training split of SC09 dataset (all .WAV files). The script failed with error:
Is there anything I did wrong? Please help me!
Thanks first!