1

I am using keras functional api and I have tensor of shape

phrasing.shape = (?, 553777, 19, 3) 

Now I want to take a max feature of unigram and bigram & trigram so the expected shape should be

(?, 553777, 19, 1) 

so I added this line

ph = MaxPooling2D ( pool_size=(1,3)  )(phrasing)

and get this error : IndexError: tuple index out of range

addam
  • 11
  • 2

1 Answers1

0

Your data is a dimension too high. I had the same issue and I solved it by dropping the layers from Conv2d to Conv1d and MaxPooling2d to MaxPooling1d. Which makes sense depending on your data format which in my case was text classification.

iantbutler
  • 431
  • 5
  • 13