2017-05-23 1 views
0

저는 파이썬에서 비디오 용 Keras 라이브러리를 사용하고 있습니다. 내 Keras 버전은 2.0.2Keras : TypeError : ('키워드 인수를 알 수 없음 :', 'nb_depth')

kernel_size=3 
model = Sequential() 
    model.add(Convolution3D(nb_filters[0], kernel_size,nb_depth=nb_conv[0], nb_row=nb_conv[0], 
    nb_col=nb_conv[0],input_shape=(1, img_rows, img_cols, patch_size), 
    activation='relu')) 

나는 다음과 같은 오류를 얻고있다.

Using Theano Backened 
    Traceback (most recent call last): 
    File "F:/Project/codes/foreg.py", line 131, in <module> 
    input_shape=(1, img_rows, img_cols, patch_size), activation='relu')) 
    File "C:\Users\lenov\Anaconda3\envs\3dcnn\lib\site-packages\keras\legacy\interfaces.py", line 88, in wrapper 
    return func(*args, **kwargs) 
    File "C:\Users\lenov\Anaconda3\envs\3dcnn\lib\site-packages\keras\layers\convolutional.py", line 580, in __init__ 
    **kwargs) 
    File "C:\Users\lenov\Anaconda3\envs\3dcnn\lib\site-packages\keras\layers\convolutional.py", line 100, in __init__ 
    super(_Conv, self).__init__(**kwargs) 
    File "C:\Users\lenov\Anaconda3\envs\3dcnn\lib\site-packages\keras\engine\topology.py", line 277, in __init__ 
    raise TypeError('Keyword argument not understood:', kwarg) 
TypeError: ('Keyword argument not understood:', 'nb_depth') 

이 오류와 관련하여 도움을주십시오. 오류 메시지가 적혀

kernel_size: An integer or tuple/list of 3 integers, specifying the width and height of the 3D convolution window. Can be a single integer to specify the same value for all spatial dimensions.

답변

0

당신은 바로 같은 필터의 수 후 커널 크기를 지정해야합니다 당신이 kernel_size를 제공하지 않았다 Convolution3D 생성자에 대한 인수.

documentation을 확인하십시오. 문서에서

는 :

Conv3D(filters, kernel_size, strides=(1, 1, 1), padding='valid', data_format=None, dilation_rate=(1, 1, 1), activation=None, use_bias=True, kernel_initializer='glorot_uniform', bias_initializer='zeros', kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, bias_constraint=None)

+0

커널 크기를 지정하면 위의 오류가 발생합니다. 내가 변경했습니다 –

+0

"nb_depth"와 같은 인수 또는 다른 키워드를 넘겨서는 안됩니다. 다음 키워드에 해당하는 인수 만 전달할 수 있습니다 : strides, padding, data_format, dilation_rate, 활성화, use_bias, kernel_initializer, bias_initializer, kernel_regularizer, bias_regularizer, activity_regularizer, kernel_constraint, bias_constraint. – michetonu

0

: 다음 documentation에서

kernel_size = 3 
model.add(Convolution3D(nb_filters[0], kernel_size, nb_depth=nb_conv[0], nb_row=nb_conv[0], 
    nb_col=nb_conv[0],input_shape=(1, img_rows, img_cols, patch_size), 
    activation='relu')) 

:

+0

kernel_size를 추가했지만 위의 오류가 나타납니다. –

0

나는 작업 환경에서

pip install mkdocs 

설치 mkdocs으로 내 문제를 해결했다.

관련 문제