1

My mxnet code - which consists of a series of complex connections and slicing raises the following error:

Error in operator concat0: [03:03:51] src/operator/./concat-inl.h:211: Not enough information to infer type in Concat.

Im not sure how to interpret that or what information to provide to help debug it. Concat0 is part of the operation:

# Define take_column function as transpose(take(transpose(x), i))

for i in range(47):
    y_hat_lt = take_column(y_hat,
                mx.sym.concat(mx.sym.slice(some_indices, begin=i, end=i+1), self.label_dim + mx.sym.slice(some_indices, begin=i, end=i+1), dim=0))

here some_indices is a variable which I fix to be a list. Do let me know!

Drew
  • 65
  • 5

2 Answers2

2

It looks like MXNet is not able to infer the shape of output. Did you specify the shape for variable some_indices?

e.g. some_indices = mx.sym.var('indices', shape=(1,1))

It would be nice if you can paste a minimum reproducible code :)

eric-haibin-lin
  • 377
  • 2
  • 9
0

Instead of taking transpose, swapping among the axis resolved the issue.

def ttake( x, i ):
    """ Take from axis 1 instead of 0.
    """
    a = mx.sym.swapaxes(x, dim1=0, dim2=1)
    return mx.sym.flatten( mx.sym.transpose( mx.sym.take( a , i ) ) )
Drew
  • 65
  • 5
rgaut
  • 3,159
  • 5
  • 25
  • 29