I finally figure out that this is because this model is saved according to state_dict.
After that ı try to apply this tutorial but ı faced another problem that there is no a nn model that must be saved or load with state_dict, in short, ı have no class like class TheModelClass(nn.Module), just want to use a trained model.
Maybe using backbone stated in model page to load model with state_dict would be useful, like so:
from torchvision import transforms
import torchvision.models as models
device = torch.device("mps")
model = models.resnet50() ## adding this backbone according to model shared page
model.load_state_dict(torch.load("epoch_50.pth", map_location = device))
transform = transforms.ToTensor()
image = "exmp.jpg"
image = cv2.imread(image)
input = transform(image)
input = input.unsqueeze(0)
result = model(input)
but unfortunately this approach also ends up with a fancy another problem like:
Thank you for your response, this is a good point, but unfortunately, ı think the major problem is what that model must be. Because, ı just want to use a pre-trained model, not a nn model has written from scratch.
and as depicted below, backbone approach is also not working.