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

Issue with moments.pkl #28

Closed
karanpareek96 opened this issue Feb 27, 2019 · 11 comments
Closed

Issue with moments.pkl #28

karanpareek96 opened this issue Feb 27, 2019 · 11 comments

Comments

@karanpareek96
Copy link

Hi,

I set everything up correctly but I'm not able to run the SpecGAN scripts. I used the command that was given in the help file but I'm not able to generate anything. The program gives me an error for data_moments_fp.

Thanks

@chrisdonahue
Copy link
Owner

Hi there.

Can you give me a bit more context? Did you run the script to extract the moments (spectrogram bin means and variances) from your dataset? Was there any output from that script (it may take a while)? Can you locate the moments.pkl file?

python train_specgan.py moments ./train \
	--data_dir ./data/dir_with_mp3s \
	--data_moments_fp ./train/moments.pkl

@karanpareek96
Copy link
Author

Hi Chris,

Thanks for getting back to me.

I am currently running SpecGAN using the srun functionality. I have imported all the required packages to execute the file. Yes, I did run the moments script to extract the mean and variance but I get an error saying that the moments.pkl file cannot be found.

Do you recommend that I update any existing libraries in my system to achieve success?

PS: Big fan of your work :)

@karanpareek96
Copy link
Author

screen shot 2019-02-28 at 5 37 47 pm

@chrisdonahue
Copy link
Owner

I think this means that the loader is not successfully loading any data (the spectrogram array is empty). How many audio files does the script say it found? Are they all the exact same format? Do you have librosa installed?

To get an idea of where exactly the script is breaking, change lines 202/203 to:

    while True:
      try:
        _X_lmag = sess.run(X_lmag)
      except Exception as e:
        print(e)
        break

@karanpareek96
Copy link
Author

Hi Chris,

I implemented the code that you suggested and it worked. I had made a big blunder while running the program. My directory extension wasn't correct, so instead of importing audio files, it was importing the folders, resulting in the error.

Thanks for your help!

@youngjung
Copy link

Hi Chris,

I have the same issue computing moments from SC09 dataset.

Traceback (most recent call last):
  File "train_specgan.py", line 758, in <module>
    moments(fps, args)
  File "train_specgan.py", line 612, in moments
    _X_lmags = np.concatenate(_X_lmags, axis=0)
ValueError: need at least one array to concatenate

Below is from your checklist above.
len(fps) = 2494
fps[0] = '/home/data/sc09/valid/Eight_060cd039_nohash_0.wav'
librosa==0.6.2 is installed.
and except Exception as e: print(e) gave me

End of sequence
	 [[{{node IteratorGetNext}} = IteratorGetNext[output_shapes=[[1,16384,1,1]], output_types=[DT_FLOAT]](IteratorFromStringHandleV2)]]
	 [[node loader/ExperimentalFunctionBufferingResourceGetNext (defined at /home/wavegan/loader.py:198)  = ExperimentalFunctionBufferingResourceGetNext[output_types=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:GPU:0"](loader/ExperimentalFunctionBufferingResource)]]
	 [[{{node Log/_9}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_50_Log", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

Could you help me solving this issue?

@chrisdonahue
Copy link
Owner

Hi @youngjung. I'm not 100% sure what's going on. Are you using the correct version of tensorflow (1.12.0)? Can you try installing scipy and using --data_fast_wav as a command line input to use scipy instead of librosa?

@youngjung
Copy link

Yes I am using tf-1.12.0

$ pip show tensorflow-gpu
Name: tensorflow-gpu
Version: 1.12.0

I tried

$ python train_specgan.py moments ./experiments     --data_dir ~/data/sc09/valid/     --data_moments_fp ./experiments/moments.pkl --data_fast_wav
Found 2494 audio files in specified directory

and it still gives me

End of sequence
	 [[{{node IteratorGetNext}} = IteratorGetNext[output_shapes=[[1,16384,1,1]], output_types=[DT_FLOAT]](IteratorFromStringHandleV2)]]
	 [[node loader/ExperimentalFunctionBufferingResourceGetNext (defined at /home/wavegan/loader.py:198)  = ExperimentalFunctionBufferingResourceGetNext[output_types=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:GPU:0"](loader/ExperimentalFunctionBufferingResource)]]
	 [[{{node Log/_9}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_50_Log", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
stat...
len = 0
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)
ValueError: need at least one array to concatenate

@sanchita-ghose
Copy link

@youngjung Have you solved the issue? I am facing the same error.

@fredbuhl
Copy link

I'm having the same issue here with working with train_specgan.py and sc09/train. Can we get a reopen? Happy to help...

python packages: (I'm using virtualenv--very helpful!); Ubuntu 16.04:
absl-py==0.9.0
astor==0.8.1
audioread==2.1.8
cffi==1.14.0
cycler==0.10.0
decorator==4.4.2
gast==0.3.3
grpcio==1.29.0
h5py==2.10.0
importlib-metadata==1.6.1
joblib==0.14.1
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver==1.1.0
librosa==0.6.2
llvmlite==0.32.1
Markdown==3.2.2
matplotlib==3.0.2
numba==0.47.0
numpy==1.16.4
protobuf==3.12.2
pycparser==2.20
pyparsing==2.4.7
python-dateutil==2.8.1
resampy==0.2.2
scikit-learn==0.22.2.post1
scipy==1.0.0
six==1.15.0
SoundFile==0.10.3.post1
tensorboard==1.12.2
tensorflow-gpu==1.12.0
termcolor==1.1.0
Werkzeug==1.0.1
zipp==1.2.0

@hellog2n
Copy link

hellog2n commented Aug 7, 2023

I have same error.

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

6 participants