I have below code which I am trying to understand keras mean and want to get pooled_grads print. While printing I am getting below error
import numpy as np
import tensorflow as tf
arr3 = np.array([ [
[1,2,3],
[4,5,6]
],
[
[1,2,3],
[4,5,6]
],
[
[1,2,3],
[4,5,6]
]
]
)
#print("Arr shape", arr3.shape)
import keras.backend as K
import numpy as np
pooled_grads = K.mean(arr3, axis=(0, 1, 2))
print("------------------------")
print(pooled_grads)
I am getting below error
AttributeError: 'numpy.dtype' object has no attribute 'base_dtype'
arr3is 3d,K.mean(arr3)is equivalent toK.mean(arr3, axis=(0,1,2))print(pooled_grads)but on theK.mean(arr3, axis=(0,1,2))