mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

update wavenet codes

Open seujung opened this issue 6 years ago • 24 comments

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

seujung avatar Dec 27 '18 08:12 seujung

Hi @seujung thank you for the contribution. Do you mind putting code and document directly in folder, instead of having a git submodule?

TaoLv avatar Dec 27 '18 08:12 TaoLv

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?

pengzhao-intel avatar Jan 04 '19 13:01 pengzhao-intel

@thomelane @ThomasDelteil could you review it? Thanks!

stu1130 avatar Jan 17 '19 20:01 stu1130

execute pylint test and push codes

seujung avatar Feb 13 '19 05:02 seujung

@vandanavk @ThomasDelteil Could you please check if your comments have been addressed?

ankkhedia avatar Feb 15 '19 22:02 ankkhedia

@seujung could you please address the latest comments?

@ThomasDelteil Could you please check if your comments are addressed?

abhinavs95 avatar Mar 25 '19 23:03 abhinavs95

@abhinavs95 the latest comment is https://github.com/apache/incubator-mxnet/pull/13735/commits/ee24721f4a6474ebb26f6ffd19da6ebbb31cf5fd. Apply the hybridize.

seujung avatar Mar 25 '19 23:03 seujung

@seujung Did you address all the PR feedback ? Also can you look into the failing CI ?

piyushghai avatar Apr 09 '19 00:04 piyushghai

@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.

seujung avatar Apr 09 '19 05:04 seujung

@piyushghai I solve the problem falling CI.

seujung avatar Apr 11 '19 07:04 seujung

@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?

pengzhao-intel avatar Apr 12 '19 03:04 pengzhao-intel

@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 avatar Apr 14 '19 01:04 juliusshufan

@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 avatar Apr 16 '19 02:04 seujung

@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 avatar Apr 17 '19 08:04 GHGmc2

@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 avatar Apr 17 '19 13:04 seujung

@seujung can you please look at @ThomasDelteil comments. I think a few them are still pending.

anirudhacharya avatar May 02 '19 19:05 anirudhacharya

@mxnet-label-bot add[pr-awaiting-response]

pinaraws avatar May 20 '19 16:05 pinaraws

@mxnet-label-bot remove[pr-awaiting-review]

pinaraws avatar May 20 '19 16:05 pinaraws

@seujung Could you have a look at the latest review comments? Thanks!

abhinavs95 avatar May 31 '19 18:05 abhinavs95

Could you give me a comment to fix a code? I think that I reflected most requests.

seujung avatar Jun 07 '19 05:06 seujung

@vishaalkapoor @ThomasDelteil @vandanavk Can you see if your review comments are addressed?

Roshrini avatar Jun 23 '19 21:06 Roshrini

@ThomasDelteil @safrooze @wkcn Could you please review this PR again? Thanks!

karan6181 avatar Jul 18 '19 18:07 karan6181

@ThomasDelteil @wkcn Can you guys please review this ? Thanks!

piyushghai avatar Aug 02 '19 20:08 piyushghai

@ThomasDelteil @wkcn @vishaalkapoor Gentle ping..

karan6181 avatar Aug 29 '19 16:08 karan6181