对于以下代码:
imgs = theano.shared(numpy.asarray(numpy.random.uniform((batch_size,c,n1,n2)),dtype=theano.config.floatX))
imgs = imgs.dimshuffle((0,'x', 1, 2, 3))
我收到以下错误:
ValueError: new_order[2] is 1, but the input only has 1 axes.
我没有看到问题究竟在哪里。有什么想法吗?
答案 0 :(得分:0)
你忘了告诉参数是(batch_size,c,n1,n2)
imgs = theano.shared(numpy.asarray(numpy.random.uniform(size=(batch_size,c,n1,n2)),dtype=theano.config.floatX))
imgs = imgs.dimshuffle((0,'x', 1, 2, 3))