TypeError: Unknown parameter type: <type 'int'>

54 views
Skip to first unread message

Bonan Jin

unread,
Jun 4, 2019, 8:37:51 PM6/4/19
to theano-users
I met with this error, and have no idea how to fix it. Very appreciate it if there is any help.

/home/ubuntu/anaconda3/envs/theano_p27/lib/python2.7/site-packages/theano/compile/function.pyc in function(inputs, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input)
    315                    on_unused_input=on_unused_input,
    316                    profile=profile,
--> 317                    output_keys=output_keys)
    318     return fn

/home/ubuntu/anaconda3/envs/theano_p27/lib/python2.7/site-packages/theano/compile/pfunc.pyc in pfunc(params, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input, output_keys)
    395     # transform params into theano.compile.In objects.
    396     inputs = [_pfunc_param_to_in(p, allow_downcast=allow_input_downcast)
--> 397               for p in params]
    398 
    399     # Check if some variable is present more than once in inputs

/home/ubuntu/anaconda3/envs/theano_p27/lib/python2.7/site-packages/theano/compile/pfunc.pyc in _pfunc_param_to_in(param, strict, allow_downcast)
    494     elif isinstance(param, In):
    495         return param
--> 496     raise TypeError('Unknown parameter type: %s' % type(param))
    497 
    498 

TypeError: Unknown parameter type: <type 'int'>

Here is the code related:

K.set_learning_phase(0)
self.dF = function([z, K.learning_phase()], grad(Q, wrt=z), allow_input_downcast=True)

Reply all
Reply to author
Forward
0 new messages