1
내 Keras 모델에서 길쌈 레이어를 통과 한 후 내 데이터가 어떻게 표시되는지 확인하려고합니다. 나는 Theano 백엔드를 사용하고 있습니다. 내가 가진 코드는 Keras Github에서에서 함께 자갈길되었습니다Keras 모델에서 레이어의 출력을 얻으려고 할 때 IndexError가 발생했습니다.
def get_layer0_outputs(model, test_data):
output = model.layers[0].output
inputs = [K.learning_phase()] + model.inputs
func = K.function(inputs, [output])
return func([0] + [test_data])
는 내가 여기서 할 노력하고있어 내 네트워크의 첫 번째 레이어 (A Conv2D 층)하는 기능을 컴파일합니다. test_data
인수는 np.ndarray
입니다. 내 모델이 올바르게로드되었고, 나는 이미 괜찮은 정확성을 가지고 그것을 훈련 시켰습니다.
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/theano/compile/function_module.py", line 884, in __call__
self.fn() if output_subset is None else\
File "/usr/local/lib/python3.5/dist-packages/theano/gof/op.py", line 872, in rval
r = p(n, [x[0] for x in i], o)
File "/usr/local/lib/python3.5/dist-packages/theano/tensor/nnet/abstract_conv.py", line 1626, in perform
conv_out = self.conv(img, kern, mode="valid", dilation=self.filter_dilation)
File "/usr/local/lib/python3.5/dist-packages/theano/tensor/nnet/abstract_conv.py", line 1531, in conv
dilated_kern[n, im0, ...],
IndexError: index 1 is out of bounds for axis 1 with size 1
이 무엇을 의미합니까 :이 함수를 호출 할 때
그러나, 나는 비밀 스택 트레이스를 얻을? 함수를 잘못 호출하고 있습니까?
흥미 롭습니다. 나는 tensorflow로 시도 할 것이다. –
Keras 및 TensorFlow의 어떤 버전을 사용하고 있습니까? 파이썬 2 또는 3을 사용하고 있습니까? –
Keraas 2.0.5, TensorFlow 1.2.1, Python 2 –