@Hengck
I’ve encountered similar problem and discovered that it’s about contiguity of the input.
Try this:
prediction = net(input.contiguous())

You can read about breaking changes in release notes for 1.5.0 version (look for “contiguous”): https://github.com/pytorch/pytorch/releases/tag/v1.5.0 21
Script for reproducing slower runtime in Pytorch >= 1.5:
import numpy as np
import torch
import torchvision

net = torchvision.models.resnet50()
net.train()
net.cuda()

images_array = np.random.randn(4, 224, 224, 3).astype(np.float32)
images_array = np.rollaxis(images_array, 3, 1)
images_tensor = torch.from_numpy(images_array)
images_tensor = images_tensor.to(device="cuda")
print(images_tensor.is_contiguous())  # False

with torch.autograd.profiler.profile(use_cuda=True) as prof:
    prediction = net(images_tensor)  # slower
    # prediction = net(images_tensor.contiguous())  # faster
print(prof)