diff --git a/reIDmodel.py b/reIDmodel.py index 2edb3b5..ee4ea47 100755 --- a/reIDmodel.py +++ b/reIDmodel.py @@ -7,7 +7,6 @@ import torch.nn as nn from torch.nn import init from torchvision import models -from torch.autograd import Variable ###################################################################### def weights_init_kaiming(m): diff --git a/reid_eval/evaluate_gpu.py b/reid_eval/evaluate_gpu.py index 29f3272..2c0167b 100755 --- a/reid_eval/evaluate_gpu.py +++ b/reid_eval/evaluate_gpu.py @@ -7,7 +7,6 @@ import scipy.io import torch import numpy as np -import time import os import matplotlib matplotlib.use('agg') diff --git a/train.py b/train.py index 80b056d..263bf62 100755 --- a/train.py +++ b/train.py @@ -4,7 +4,6 @@ """ from utils import get_all_data_loaders, prepare_sub_folder, write_loss, get_config, write_2images, Timer import argparse -from torch.autograd import Variable from trainer import DGNet_Trainer import torch.backends.cudnn as cudnn import torch diff --git a/trainer.py b/trainer.py index 77d7d4f..b1e1b72 100755 --- a/trainer.py +++ b/trainer.py @@ -2,26 +2,23 @@ Copyright (C) 2019 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). """ -from networks import AdaINGen, MsImageDis, VAEGen +from networks import AdaINGen, MsImageDis from reIDmodel import ft_net, ft_netAB, PCB -from utils import weights_init, get_model_list, vgg_preprocess, load_vgg16, get_scheduler +from utils import get_model_list, vgg_preprocess, load_vgg16, get_scheduler from torch.autograd import Variable import torch import torch.nn as nn -import torchvision import copy import os import cv2 import numpy as np from random_erasing import RandomErasing -from PIL import Image import random import yaml #fp16 try: - import apex - from apex import amp, optimizers + from apex import amp from apex.fp16_utils import * except ImportError: print('This is not an error. If you want to use low precision, i.e., fp16, please install the apex with cuda support (https://github.com/NVIDIA/apex) and update pytorch to 1.0') diff --git a/utils.py b/utils.py index 0643883..27d595b 100755 --- a/utils.py +++ b/utils.py @@ -7,7 +7,7 @@ from torch.autograd import Variable from torch.optim import lr_scheduler from torchvision import transforms -from data import ImageFilelist, ImageFolder +from data import ImageFilelist from reIDfolder import ReIDFolder import torch import os diff --git a/visual_tools/show1by1.py b/visual_tools/show1by1.py index 17e2fee..2924075 100755 --- a/visual_tools/show1by1.py +++ b/visual_tools/show1by1.py @@ -13,7 +13,7 @@ import torch import os import numpy as np -from torchvision import datasets, models, transforms +from torchvision import datasets, transforms from PIL import Image name = 'E0.5new_reid0.5_w30000'