mxnet
mxnet copied to clipboard
update wavenet codes
Description
update wavenet example codes using gluon
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
- [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
- [ ] Changes are complete (i.e. I finished coding on this PR)
- [ ] All changes have test coverage:
- Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
- Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
- Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
- [x] Code is well-documented:
- For user-facing API changes, API doc string has been updated.
- For new C++ functions in header files, their functionalities and arguments are documented.
- For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
- Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
- [x] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
Changes
- [ ] Feature1, tests, (and when applicable, API doc)
- [ ] Feature2, tests, (and when applicable, API doc)
Comments
- If this change is a backward incompatible change, why must this change be made.
- Interesting edge cases to note here
Hi @seujung thank you for the contribution. Do you mind putting code and document directly in folder, instead of having a git submodule?
Thanks for the contribution. It's nice to see the wavenet examples in MXNet. @seujung would you mind providing some data about the training/inference accuracy, performance on CPU/GPU for this example?
@thomelane @ThomasDelteil could you review it? Thanks!
execute pylint test and push codes
@vandanavk @ThomasDelteil Could you please check if your comments have been addressed?
@seujung could you please address the latest comments?
@ThomasDelteil Could you please check if your comments are addressed?
@abhinavs95 the latest comment is https://github.com/apache/incubator-mxnet/pull/13735/commits/ee24721f4a6474ebb26f6ffd19da6ebbb31cf5fd. Apply the hybridize.
@seujung Did you address all the PR feedback ? Also can you look into the failing CI ?
@piyushghai Yes. I solve the suggested issues @marcoabreu Could you check the job fail in unix-cpu? Because, this pull request does not have any test code.
@piyushghai I solve the problem falling CI.
@ThomasDelteil @safrooze @wkcn @vandanavk please help review again. Adding more examples is a really good thing for the community and look forward the PR can be merged soon.
@juliusshufan could you help to verify the example in local?
@seujung I tried your example, while seems the training process can successfully completes, while on inference/generation, it failed as below back-trace:
mxnet.base.MXNetError: Error in operator wavenet0_conv0_fwd: [08:58:48] src/operator/nn/convolution.cc:103: Check failed: dshp.ndim() == 3U (1 vs. 3) Input data should be 3D in batch-num_filter-x
I checked the script implemenation, and indeed the input is a 1-d tensor,
gen_rst = self.generate_slow(initial_data[0:3000], self.net, dilation_depth=10,
n_repeat=2, n=2000, ctx=self.ctx)
May I know if I did something wrong?
@juliusshufan I find a bug to generate sound data. So, I fix the bug and I split the module to training and inference. https://github.com/apache/incubator-mxnet/pull/13735/commits/28b95b81ddddfa5b39d65b505fb49dacac161730
@seujung I tried main.py, it failed when doing inference, error message is: "generation() missing 2 required positional arguments: 'path' and 'gen_size'".
$ python main.py --epochs=1 Namespace(batch_size=64, dilation_depth=10, epochs=1, generation=True, load_file='parametric-2.wav', mu=128, n_repeat=2, n_residue=24, n_skip=128, save_file='', seq_size=20000, use_gpu=False) 0%| | 0/1 [00:00<?, ?it/s] out = self.forward(*args) epoch 0, loss 78866.3671875 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [01:34<00:00, 94.03s/it] Traceback (most recent call last): File "main.py", line 63, in
main() File "main.py", line 60, in main trainer.generation() TypeError: generation() missing 2 required positional arguments: 'path' and 'gen_size'
@GHGmc2 I found a bug in main.py and I solve this problem. https://github.com/apache/incubator-mxnet/pull/13735/commits/83e588598b32a8a50f480e505a581eeee2ac4dc8
Training
python main.py --epochs=1 Namespace(batch_size=64, dilation_depth=10, epochs=1, load_file='parametric-2.wav', mu=128, n_repeat=2, n_residue=24, n_skip=128, save_file='', seq_size=20000, use_gpu=False) 0%| | 0/1 [00:00<?, ?it/s]/Users/digit82/anaconda3/lib/python3.6/site-packages/mxnet/gluon/block.py:540: UserWarning: Parameter wavenet0_conv80_bias, wavenet0_conv80_weight is not used by any computation. Is this intended? out = self.forward(*args) epoch 0, loss 80707.8125 100%|████████████████████████████████████████████| 1/1 [03:37<00:00, 217.17s/it]
Inference
python generate_sound.py --gen_size=100 Namespace(batch_size=64, dilation_depth=10, epochs=1, gen_size=100, load_file='parametric-2.wav', model_path='./models/best_perf_epoch_963_loss_9.889945983886719', mu=128, n_repeat=2, n_residue=24, n_skip=128, save_file='wav.npy', seq_size=3000, use_gpu=False) 0%| | 0/100 [00:00<?, ?it/s]/Users/digit82/anaconda3/lib/python3.6/site-packages/mxnet/gluon/block.py:540: UserWarning: Parameter wavenet1_conv80_bias, wavenet1_conv80_weight is not used by any computation. Is this intended? out = self.forward(*args) 100%|██████████████████████████████████████████████████████████████████████████████████| 100/100 [00:14<00:00, 6.93it/s]
@seujung can you please look at @ThomasDelteil comments. I think a few them are still pending.
@mxnet-label-bot add[pr-awaiting-response]
@mxnet-label-bot remove[pr-awaiting-review]
@seujung Could you have a look at the latest review comments? Thanks!
Could you give me a comment to fix a code? I think that I reflected most requests.
@vishaalkapoor @ThomasDelteil @vandanavk Can you see if your review comments are addressed?
@ThomasDelteil @safrooze @wkcn Could you please review this PR again? Thanks!
@ThomasDelteil @wkcn Can you guys please review this ? Thanks!
@ThomasDelteil @wkcn @vishaalkapoor Gentle ping..