What is the exact output of the Inception ResNet V2's feature extraction layer?
Due to this article: https://arxiv.org/pdf/1512.00567v3.pdf?source=post_page--------------------------- , 

I try to flatten the 3-d tensor in to 1d vector: 8*8*2048, because in the article, the pool layer of inception resnet v2 at page 6 is Pool: 8 * 8 * 2048. 

But at the end, my code showed the error:
 ValueError: cannot reshape array of size 33423360 into shape (340,131072)

This is all my code:

from keras.applications.inception_resnet_v2 import InceptionResNetV2
from keras.applications.inception_resnet_v2 import preprocess_input
from keras.models import Model
from keras.preprocessing.image import load_img
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import classification_report
from imutils import paths
from keras.applications import imagenet_utils
from keras.preprocessing.image import img_to_array
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from keras.preprocessing import image
import random
import os
import numpy as np 
import cv2


# Path to image 
image_path = list(paths.list_images('/content/drive/My Drive/casia-299-small'))
# Random image path
random.shuffle(image_path)
# Get image name
labels = [p.split(os.path.sep)[-2] for p in image_path]


# Encode face name in to number
le = LabelEncoder()
labels = le.fit_transform(labels)

# Load model inception v2, include_top = Fale to ignore Fully Connected layer
model = InceptionResNetV2(include_top = False, weights = 'imagenet')


# Load images and resize into required input size of Inception Resnet v2 299x299
list_image = []
for (j, imagePath) in enumerate(image_path):
    image = load_img(imagePath, target_size = (299, 299, 3))
    image = img_to_array(image)

    image = np.expand_dims(image, 0)
    image = imagenet_utils.preprocess_input(image)

    list_image.append(image)

# Use pre-trained model to extract feature
list_image = np.vstack(list_image)
print("LIst image: ", list_image)
features = model.predict(list_image)
print("feature: ", features)
print("feature shape[0]: ", features.shape[0])
print("feature shape: ", features.shape)
features = features.reshape((features.shape[0], 8*8*2048))

# Split training set and test set n ratio of 80-20
x_train, x_test, y_train, y_test = train_test_split(features, labels, test_size = 0.2, random_state =42)

params = {'C': [0.1, 1.0, 10.0, 100.0]}
model = GridSearchCV(LogisticRegression(), params)
model.fit(x_train,y_train)
model.save('/content/drive/My Drive/casia-299-small/myweight1.h5')
print('Best parameter for the model {}'.format(model.best_params_))

preds = model.predict(x_test)
print(classification_report(y_test, preds))
```