Can not load and test CNN model

I am trying to load a model saved in a location as .pt file. I am trying to read the model as but it is giving me an AttributeError and/or a TypeError stating “missing 1 required positional argument: ‘self’” at .cuda() and .eval() lines.

import sys
sys.path.insert(0, '/home/nkaushal/network/models')
sys.path.insert(0, '/home/nkaushal/network/utils')
import yadoc
from   utils     import *
from   libraries import *
from model_3 import UNet

param_file  = sys.argv[1]
params      = yadoc.parameters('/home/nkaushal/network/params/test_params_{}.yml'.format(param_file))

test_set     = high_dimensional_dataset(,, params.test.lIndex, params.test.hIndex, params.test.aug)
test_loader  = DataLoader(test_set, batch_size=params.test.batch_size, shuffle=True, num_workers=params.test.num_workers)

def test_prediction(path, model, test_loader):
    net = torch.load(model)

    for test_batch, test_data in enumerate(test_loader, 0):
        inputs, labels = test_data
        NetInput = torch.autograd.Variable(inputs,requires_grad=False).cuda()
        Y_pred = net(NetInput)'test_'+str(test_batch)+'.npy',np.concatenate((np.squeeze($

return None

if params.test.is_test:
    test_prediction(params.out_path, params.model_path, test_loader)

The recommended way to serialize the model is to store and load the state_dict and to recreate the model object as explained here.
Based on the error message I guess that loading the complete model fails.