ValueError: total size of new array must be unchanged

610 views
Skip to first unread message

Tby

unread,
Sep 2, 2014, 4:04:08 PM9/2/14
to theano...@googlegroups.com
Hey there,

Im trying to use theano CNN implementation on audio and i get this error:

ValueError: total size of new array must be unchanged

i was wondering what is the core of the problem, my guess the the shapes i use are wrong.  how can i make sure that im consistent with input shapes and  Inputs strides dimensions ?

Thanks,
T.

Arjun Jain

unread,
Sep 2, 2014, 4:51:40 PM9/2/14
to theano...@googlegroups.com
Maybe checkout the tag.test_value feature. 
--

---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Frédéric Bastien

unread,
Sep 2, 2014, 9:03:09 PM9/2/14
to theano-users
When you paste error, give the full error. It help a lot.

From another email, this error was raised by a GpuReshape op. The problem is that in the code you use, a reshape try to change the number of element of its input. Check the reshape in your code.

Otherwise, if you use the development version of Theano, the full error message will also contain the backtrace where the reshape was created.


Fred

Tby

unread,
Sep 3, 2014, 2:56:02 PM9/3/14
to theano...@googlegroups.com
this is the error:
ValueError: total size of new array must be unchanged
Apply node that caused the error: Reshape{4}(Subtensor{int64:int64:}.0, TensorConstant{[  1   1 128 174]})
Inputs shapes: [(2, 174), (4,)]
Inputs strides: [(8, 1024), (8,)]
Inputs types: [TensorType(float64, matrix), TensorType(int64, vector)]
Use the Theano flag 'exception_verbosity=high' for a debugprint of this apply node.

did you mean the first layer reshape? layer0=x.reshape(...)?
unfortunately i didnt see the problem yet..

Thanks,


On Tuesday, September 2, 2014 6:03:09 PM UTC-7, nouiz wrote:
When you paste error, give the full error. It help a lot.

From another email, this error was raised by a GpuReshape op. The problem is that in the code you use, a reshape try to change the number of element of its input. Check the reshape in your code.

Otherwise, if you use the development version of Theano, the full error message will also contain the backtrace where the reshape was created.


Fred

On Tue, Sep 2, 2014 at 4:51 PM, Arjun Jain <arju...@gmail.com> wrote:
Maybe checkout the tag.test_value feature. 


On Tuesday, September 2, 2014, Tby <tal...@gmail.com> wrote:
Hey there,

Im trying to use theano CNN implementation on audio and i get this error:

ValueError: total size of new array must be unchanged

i was wondering what is the core of the problem, my guess the the shapes i use are wrong.  how can i make sure that im consistent with input shapes and  Inputs strides dimensions ?

Thanks,
T.

--

---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Arjun Jain

unread,
Sep 3, 2014, 3:54:24 PM9/3/14
to theano-users
Could you try the compute_test_value? Maybe have a look at: http://deeplearning.net/software/theano/tutorial/debug_faq.html
# enable on-the-fly graph computations
theano.config.compute_test_value = 'warn'

...

# input which will be of shape (5, 10)
x  = T.matrix('x')
# provide Theano with a default test-value
x.tag.test_value = numpy.random.rand(5, 10)


stan...@hotmail.co.uk

unread,
Sep 18, 2014, 11:35:56 AM9/18/14
to theano...@googlegroups.com
Did anybody figure out a way to resolve this? Or what variables in particular were causing the mismatch error?

I am having exactly the same problem with the CNN implementation using audio.


Pascal Lamblin

unread,
Sep 19, 2014, 10:54:09 AM9/19/14
to theano...@googlegroups.com
On Thu, Sep 18, 2014, stan...@hotmail.co.uk wrote:
> Did anybody figure out a way to resolve this? Or what variables in
> particular were causing the mismatch error?

Using test values could help:
http://deeplearning.net/software/theano/tutorial/debug_faq.html#using-test-values

> I am having exactly the same problem with the CNN implementation using
> audio.

--
Pascal
Reply all
Reply to author
Forward
0 new messages