Closed pasmargo closed 4 years ago
We'll have a new release of gluonnlp to support the numpy interface. For now just convert the array to nd before calling the beamsearchsample
cc @sxjscience
For the numpy version, you may try to use the version that is initiated in https://github.com/dmlc/gluon-nlp/pull/1225
Description
I follow the instructions to generate sequences with Beam Search and it works correctly when the input is an mx.nd object. However, I get an error message when the input is an mx.numpy object.
With the original line, it works correctly:
With this other line, it makes the sampler fail:
Error Message
To Reproduce
Use the code for the sequence generation using Beam Search in this link:
https://gluon-nlp.mxnet.io/examples/sequence_sampling/sequence_sampling.html
And substitute the line
with
What have you tried to solve it?
.as_nd_ndarray()
. It gets passed that error, but then Gluon Blocks requires all outputs to be mx.numpy and it fails in an old reshape method (mx.numpy should not have a named shape argument):Environment
We recommend using our script for collecting the diagnositc information. Run the following command and paste the outputs below:
paste outputs here