0

I am using max_pooling function using chainer for maxpooling operation in CNN.

I am getting the following error. i have placed the code which i used for max_pooling operation.what i need to do to resolve this issue?

Pool_1=F.max_pooling_2d(Feature_map1_pool, ksize=3, stride=None, pad=0, cover_all=True, return_indices=False)
InvalidType:  Invalid operation is performed in: MaxPooling2D
(Forward)

Expect: in_types[0].dtype.kind == f

Actual: O != f
mate00
  • 2,727
  • 5
  • 26
  • 34
  • Please see https://docs.chainer.org/en/stable/tips.html#how-do-i-fix-invalidtype-error and confirm if the input data type is correct. – kmaehashi Jul 28 '19 at 18:11

1 Answers1

0
InvalidType: Invalid operation is performed in: MaxPooling2D (Forward)

Expect: in_types[0].dtype.kind == f

Actual: O != f

This error indicates that the argument Feature_map1_pool has the dtype 'O' = 'object'.

There should be some mistake in creation of the array Feature_map1_pool. There are many ways from which such array may result. The following code is just one example.

Feature_map1_pool = numpy.asarray([numpy.array([2, 2]), numpy.array([1])])
niboshi
  • 1,448
  • 3
  • 12
  • 20