-
Notifications
You must be signed in to change notification settings - Fork 6.8k
TypeError: Compose expect Symbol
as arguments
#5178
Comments
Maybe updating to latest version will help. #5114 |
@Godricly , Thank ,it works. but when I run
another error arise: I guess this is caused by bidirectional lstm, but I don't know how to fix it, can you help me |
@piiswrong, Can I used fusedrnn to struct a multilayer bidirectional lstm |
same problem. TypeError: Compose expect `Symbol` as arguments |
This issue is closed due to lack of activity in the last 90 days. Feel free to ping me to reopen if this is still an active issue. Thanks! |
I want to implement CNN_BLSTM_CTC with CUDNN, but an error arise:
Traceback (most recent call last):
File "/home/Documents/MyCode/VLPR/view.py", line 25, in
output = CNN_MultiBLSTM_CTC_CUDNN(num_hidden, num_label, num_lstm_layer)
File "/home/Documents/MyCode/VLPR/blstm.py", line 325, in CNN_MultiBLSTM_CTC_CUDNN
output, _ = cell.unroll(num_length, inputs=hidden, merge_outputs=True, layout='NTC')
File "/home/mxnet/python/mxnet/rnn/rnn_cell.py", line 637, in unroll
inputs = symbol.Concat(inputs, dim=0)
File "/home/mxnet/python/mxnet/_ctypes/symbol.py", line 191, in creator
s._compose(*args, name=name, **symbol_kwargs)
File "/home/mxnet/python/mxnet/symbol.py", line 241, in _compose
raise TypeError('Compose expect
Symbol
as arguments')TypeError: Compose expect
Symbol
as argumentsHere is my code, How can I fix it
`def CNN_MultiBLSTM_CTC_CUDNN(num_hidden, num_label, num_lstm_layer, num_class = 70, num_length = 32):
def CNN3(indata):
"""the net is similar to VGG16
each image size is 64256
"""
# stage 1
body = CNN_Module(data=indata, kernel=(3, 3), pad=(1, 1), num_filter=64, stride=(1, 1), num_module=2, BatchNorm=True)
body = mx.symbol.Pooling(data=body, pool_type="max", kernel=(2, 2), stride=(2, 2)) #32128
# stage 2
body = CNN_Module(data=body, kernel=(3, 3), pad=(1, 1), num_filter=128, stride=(1, 1), num_module=2, BatchNorm=True)
body = mx.symbol.Pooling(data=body, pool_type="max", kernel=(2, 2), stride=(2, 2)) #1664
# stage 3
body = CNN_Module(data=body, kernel=(3, 3), pad=(1, 1), num_filter=256, stride=(1, 1), num_module=2, BatchNorm=True)
body = mx.symbol.Pooling(data=body, pool_type="max", kernel=(2, 2), stride=(2, 2)) #832
# stage 4
body = CNN_Module(data=body, kernel=(3, 3), pad=(1, 1), num_filter=256, stride=(1, 1), num_module=2, BatchNorm=True)
body = mx.symbol.Pooling(data=body, pool_type="max", kernel=(2, 1), stride=(2, 1)) #432
# stage 5
body = CNN_Module(data=body, kernel=(3, 3), pad=(1, 1), num_filter=512, stride=(1, 1), num_module=2, BatchNorm=True)
body = mx.symbol.Pooling(data=body, pool_type="max", kernel=(2, 1), stride=(2, 1)) #232
# stage 5
body = CNN_Module(data=body, kernel=(2, 1), pad=(0, 0), num_filter=512, stride=(1, 1), num_module=1, BatchNorm=True)
body = mx.sym.SliceChannel(data=body, num_outputs=32, axis=3, squeeze_axis=1)
The text was updated successfully, but these errors were encountered: