I have run the training with Pytorch in Python3 how to fix this code for Python 3

  
      github.com
  
  
    chaoyuaw/pytorch-coviar/blob/master/test.py 7
"""Run testing given a trained model."""

import argparse
import time

import numpy as np
import torch.nn.parallel
import torch.optim
import torchvision

from dataset import CoviarDataSet
from model import Model
from transforms import GroupCenterCrop
from transforms import GroupOverSample
from transforms import GroupScale

parser = argparse.ArgumentParser(
    description="Standard video-level testing")
parser.add_argument('--data-name', type=str, choices=['ucf101', 'hmdb51'])
parser.add_argument('--representation', type=str, choices=['iframe', 'residual', 'mv'])


  This file has been truncated. show original

  
  
    
    
  
  


I am facing this error
Traceback (most recent call last):
File “test.py”, line 140, in 
main()
File “test.py”, line 48, in main
checkpoint = torch.load(args.weights)
File “/home/kanza/.local/lib/python3.5/site-packages/torch/serialization.py”, line 303, in load
return _load(f, map_location, pickle_module)
File “/home/kanza/.local/lib/python3.5/site-packages/torch/serialization.py”, line 459, in _load
magic_number = pickle_module.load(f)
TypeError: file must have ‘read’ and ‘readline’ attributes