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

slice indeces must be integers #39

Open
dandavies80 opened this issue Mar 8, 2019 · 2 comments
Open

slice indeces must be integers #39

dandavies80 opened this issue Mar 8, 2019 · 2 comments

Comments

@dandavies80
Copy link

I got a type error when running the convert_directory.py file. Any ideas?

Traceback (most recent call last):
File "convert_directory.py", line 15, in
convert_wav_files_to_nptensor(new_directory, block_size, max_seq_len, output_filename)
File "/Users/dan/Documents/python/GRUV-master/data_utils/parse_files.py", line 126, in convert_wav_files_to_nptensor
X, Y = load_training_example(file, block_size, useTimeDomain=useTimeDomain)
File "/Users/dan/Documents/python/GRUV-master/data_utils/parse_files.py", line 172, in load_training_example
x_t = convert_np_audio_to_sample_blocks(data, block_size)
File "/Users/dan/Documents/python/GRUV-master/data_utils/parse_files.py", line 81, in convert_np_audio_to_sample_blocks
block = song_np[num_samples_so_far:num_samples_so_far+block_size]
TypeError: slice indices must be integers or None or have an index method

@varesh007
Copy link

Same issue here, did you manage to fix it?

@varesh007
Copy link

Managed to fix it.
In convert_directory.py, cast the block size as int to avoid any other problems

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

2 participants