Open zeeshansayyed opened 5 years ago
@junrushao1994
File "/home/ec2-user/anaconda3/envs/gluon/lib/python3.7/site-packages/gluonnlp/model/transformer.py", line 1080, in call return super(TransformerDecoder, self).call(step_input, states) File "/home/ec2-user/anaconda3/envs/gluon/lib/python3.7/site-packages/gluonnlp/model/seq2seq_encoder_decoder.py", line 218, in call return super(Seq2SeqDecoder, self).call(step_input, states) File "/home/ec2-user/anaconda3/envs/gluon/lib/python3.7/site-packages/mxnet/gluon/block.py", line 548, in call out = self.forward(*args) File "/home/ec2-user/anaconda3/envs/gluon/lib/python3.7/site-packages/gluonnlp/model/transformer.py", line 1083, in forward input_shape = step_input.shape AttributeError: 'Symbol' object has no attribute 'shape'
This looks like transformer was being used as the decoder. Since transformer is still a fake HybridBlock, the call on array.shape caused the exception.
cc @szhengac @sxjscience. What do you recommend as the best way forward?
The best way is to stick to BeamSearchSampler now. Let's revise these APIs together with the integration of DeepNumpy.
I agree with @sxjscience.
Xingjian Shi notifications@github.com 于2019年10月4日周五 上午11:02写道:
The best way is to stick to BeamSearchSampler now. Let's revise these APIs together with the integration of DeepNumpy.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dmlc/gluon-nlp/issues/961?email_source=notifications&email_token=AA6GZVFILSBA7JIYQC5EZ43QM6AJNA5CNFSM4I5Q7MAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAMOFXQ#issuecomment-538501854, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6GZVGVAJJG5TPCBYNIEGDQM6AJNANCNFSM4I5Q7MAA .
Thank you. Should I keep the issue open?
@zeeshansayyed Yes, let's keep it open. We will later refactor the code of GluonNLP, which may solve the problem.
Description
(A clear and concise description of what the bug is.) I modified an existing
BeamSearchTranslator
class in this example to useHybridBeamSearchSampler
instead of regularBeamSearchSampler
. The code for the modification is as follows:While the original works as expected, the new HybridBeamSearchTranslator gives the following error:
Error Message
To Reproduce
(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)
Steps to reproduce
The way I call the above class is as follows:
Environment