first of all, thanks for your respond and your help.
this is the code
import torch
import torchvision

def hook_fn(m, i, o):
    print(o.shape)

from tqdm import tqdm
import numpy as np

transform = transforms.Compose([
  transforms.ToPILImage(),
  transforms.Resize(224),
  transforms.ToTensor()                              
])

features = []
DATADIR = ('E:/.................................')
path = os.path.join(DATADIR)  

# Iterate each image
for i in os.listdir(path):
    
  # Read the file
        img = cv2.imread(os.path.join(path,i)) 
        # Transform the image
        img = transform(img)
            
        hook=model.classifier[4].register_forward_hook(hook_fn)
        img = img.reshape(1, 3, 224, 224)
        img = img.to(device)
        model.eval()

        with torch.no_grad():
             feature = model(img)
            
        features.append(feature.cpu().detach().numpy().reshape(-1))

features = np.array(features)

I got this output

However when I use feautres.shape I got (826,1)