The problem is that the input you use is of size (3 x 299 x 3) as (chan x height x width) and you try to apply a 5x5 kernel to it. But in the width dimension, you have only 5 elements, and so your kernel is too big for the input you gave.