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

using seed audio #9

Open
materialvision opened this issue Dec 17, 2020 · 9 comments
Open

using seed audio #9

materialvision opened this issue Dec 17, 2020 · 9 comments

Comments

@materialvision
Copy link

Thanks for keeping the Samplernn alive!
Using generate.py with seed audio I get this error message:

Traceback (most recent call last):
File "generate.py", line 227, in
main()
File "generate.py", line 222, in main
generate(args.output_path, args.checkpoint_path, config, args.num_seqs, args
.dur,
File "generate.py", line 190, in generate
init_samples[:, :model.big_frame_size, :] = quantize(seed_audio, q_type, q_l
evels)
TypeError: 'tensorflow.python.framework.ops.EagerTensor' object does not support
item assignment

Any hint on what I can do to get the seed audio function working?

@materialvision
Copy link
Author

Sorry I see now the similar question in this issue: #6

@relativeflux
Copy link
Member

@materialvision Hi,yes - apologies, this is a known bug I was going to fix a while back but didn't get around to - will sort it ASAP.

Thanks!

@fdb
Copy link

fdb commented Jan 12, 2021

Hi @relativeflux, would love to see if this can be fixed!

I'm currently generating without any seed which works; does the algorithm then use noise as its seed?

@ezrababski
Copy link

Echoing the above comments—getting the same error (but very much appreciating the code)!

@relativeflux
Copy link
Member

Thanks. @fdb Actually it's using silence (128 at q_levels=256). @ezrababski I do have a fix for this now, I will push it out later today or tomorrow. Looking to improve that code, as it doesn't really do much to modify the generated samples... WaveNet uses a much larger seed size, so I'm looking in that direction.

@fdb
Copy link

fdb commented Jan 12, 2021

This is the code I currently use as a workaround (basically converting to numpy and back):

    if seed is not None:
        seed_audio = load_seed_audio(seed, seed_offset, model.big_frame_size)
        np_quantized = quantize(seed_audio, q_type, q_levels).numpy()
        np_init_samples = init_samples.numpy()
        np_init_samples[:, :model.big_frame_size, :] = np_quantized
        init_samples = tf.convert_to_tensor(np_init_samples)

@fdb
Copy link

fdb commented Jan 15, 2021

Hi @relativeflux , is the fix I posted any help in fixing this issue?

@relativeflux
Copy link
Member

Hi @fdb, I've just pushed a fix, similar to your own. Apologies for the delay. Seeding works again now, at least it doesn't error - it still doesn't seem to actually make any real difference to the end result, however. I'm looking into this.

@fdb
Copy link

fdb commented Jan 15, 2021

Thanks! Looks good!

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

4 participants