You are returning the model only, while trying to assign resnet_model, history as seen here:
def fun():
    model = models.resnet18()
    return model

model = fun() # works
model, history = fun()
# > TypeError: cannot unpack non-iterable ResNet object