2017-12-23 3 views
1

내 프로그램은 처음 6 개의 행이 입력 인 CSV 파일을 가져옵니다. 내 입력 모양이 3 차원 인 Keras - throwing 오류

입력 내가 사용 정의 :

inputs = Input(shape=(2697, 6)) 
2697은 배치 크기

6은 입력 크기입니다. Input(shape=(batch-size, input-size))이 정확한지 알고 있습니다. 입력 확인시 오류 : 에 ValueError : 나는 그것을 실행할 때

그러나 나는 메시지가 3 차원이 예상 INPUT_1을하지만 모양과 배열을 가지고 (2,697을, 6)

왜 keras입니다 이것을 3 차원 모양으로 줍니까?

답변

1

Keras가 자동으로 추가하므로 일괄 처리 크기 치수를 입력 모양에 넣으면 안됩니다. 이 때문에 2 차원 입력 모양이 3 차원이됩니다. Input 문서에서

inputs = Input(shape=(6,)) 
2

: 그냥이 줄을 변경

Arguments

  • shape: A shape tuple (integer), not including the batch size. For instance, shape=(32,) indicates that the expected input will be batches of 32-dimensional vectors.

  • batch_shape: A shape tuple (integer), including the batch size. For instance, batch_shape=(10, 32) indicates that the expected input will be batches of 10 32-dimensional vectors. batch_shape=(None, 32) indicates batches of an arbitrary number of 32-dimensional vectors.

그래서 그냥 변경할 수 있습니다 shapebatch_shape

Input(batch_shape=(2697, 6))