Ошибка типа: неизвестный тип параметра: <class 'int'> в theano - PullRequest
1 голос
/ 05 июня 2019

Я получил эту ошибку:

~/anaconda3/envs/theano_p36/lib/python3.6/site- 
packages/theano/compile/function.py 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

~/anaconda3/envs/theano_p36/lib/python3.6/site- 
packages/theano/compile/pfunc.py 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

~/anaconda3/envs/theano_p36/lib/python3.6/site- 
packages/theano/compile/pfunc.py in <listcomp>(.0)
    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

~/anaconda3/envs/theano_p36/lib/python3.6/site- 
packages/theano/compile/pfunc.py 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: <class 'int'>

Это связанный код:

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

Я понятия не имею, где проблема, и я буду признателен за любую помощь.Я установил keras_learning_phase на 0.

...