根据本教程,我正在尝试使用LSTM Cell:
https://mxnet.apache.org/versions/1.2.1/api/python/gluon/rnn.html
model = mx.gluon.rnn.SequentialRNNCell()
model.add(mx.gluon.rnn.LSTMCell(20))
model.add(mx.gluon.rnn.LSTMCell(20))
states = model.begin_state(batch_size=32)
input = mx.nd.random.uniform(shape=(32, 10))
model.initialize()
model(input, states)
我收到以下错误:
ValueError: Deferred initialization failed because shape cannot be inferred. Operator FullyConnected registered in backend is known as FullyConnected in Python. This is a legacy operator which can only accept legacy ndarrays, while received an MXNet numpy ndarray. Please call as_nd_ndarray() upon the numpy ndarray to convert it to a legacy ndarray, and then feed the converted array to this operator.
它怎么了?我使用的是MXnet“2.0.0”,找不到任何最新的教程。