Solution are to migrate to the latest version 0.9 or change broadcasting

On Tuesday, April 18, 2017 at 9:40:09 AM UTC-7, Rafael Valle wrote:
>
> Hi all,
>
> I'm getting errors when running the code below. Happens with Theano 
> 0.9.0dev3.dev-RELEASE but not with 0.9.
> Any help is much appreciated!
>
> import theano
> import theano.tensor as T
> import numpy as np
>
> from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
> srng = RandomStreams(seed=np.random.randint(2147462579, size=6))
>
> alpha = srng.uniform((64, 1, 1, 1), low=0., high=1.)
> img = srng.uniform((64, 1, 28, 28), low=0., high=1.)
> z = alpha * img
> f = theano.function([], z)
>
> ValueError: Input dimension mis-match. (input[0].shape[2] = 1, 
> input[1].shape[2] = 28)
> Apply node that caused the error: Elemwise{Mul}[(0, 
> 0)](mrg_uniform{TensorType(float32, 4D),inplace}.1, 
> mrg_uniform{TensorType(float32, 4D),inplace}.1)
> Toposort index: 2
> Inputs types: [TensorType(float32, 4D), TensorType(float32, 4D)]
> Inputs shapes: [(64, 1, 1, 1), (64, 1, 28, 28)]
> Inputs strides: [(4, 4, 4, 4), (3136, 3136, 112, 4)]
> Inputs values: ['not shown', 'not shown']
> Outputs clients: [['output']]
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to