Thank you for your answer.
I tried your suggestion, but I got error in evaluation phase:
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 375 and 399 in dimension 2 at /opt/conda/conda-bld/pytorch_1570710853631/work/aten/src/TH/generic/THTensor.cpp:689
I think GoogLeNet only accepts images whose size is 299 * 299.