i have changed
self.new_fc = nn.Linear(3224224, num_class)
but i had the following error
RuntimeError: mat1 and mat2 shapes cannot be multiplied (8x2048 and 150528x1)
as after these lines the input is like that
input=input.view((-1,self.new_length,3)+ input.size()[-2:])
        print("input181")

        print(input.shape)

        input=input.permute(0,2,1,3,4).contiguous()

        print("input185")

        print(input.shape)

input181
torch.Size([8, 8, 3, 224, 224])
input185
torch.Size([8, 3, 8, 224, 224])
base193