DeblurGANv2 icon indicating copy to clipboard operation
DeblurGANv2 copied to clipboard

Problems in running under Windows

Open FZY2019 opened this issue 5 years ago • 7 comments

First of all, thank you very much for your contribution. When I use your data to train again, the following problems arise. How to solve them? 2

FZY2019 avatar Nov 20 '19 10:11 FZY2019

I tried the following code train.py

def _run_epoch(self, epoch):   #tq = tqdm.tqdm(self.train_dataset, total=epoch_size)   tq = tqdm.tqdm(self.train_dataset.dataset, total=epoch_size)

But the following problem occurs

wakanawakana avatar Dec 10 '19 06:12 wakanawakana

and

models.py First aid This arrangement is a copy of predict.py `

def get_input(self, data):
    img = data['a']
    inputs = img
    img = data['b']
    targets = img
    #inputs, targets = inputs.cuda(), targets.cuda()
    return self.array_to_batch(inputs), self.array_to_batch(targets)

def array_to_batch(self, x):
    #x = np.transpose(x, (2, 0, 1))
    x = np.expand_dims(x, 0)
    return torch.from_numpy(x).cuda()

`

wakanawakana avatar Dec 10 '19 07:12 wakanawakana

image

wakanawakana avatar Dec 10 '19 07:12 wakanawakana

and

models.py First aid This arrangement is a copy of predict.py `

def get_input(self, data):
    img = data['a']
    inputs = img
    img = data['b']
    targets = img
    #inputs, targets = inputs.cuda(), targets.cuda()
    return self.array_to_batch(inputs), self.array_to_batch(targets)

def array_to_batch(self, x):
    #x = np.transpose(x, (2, 0, 1))
    x = np.expand_dims(x, 0)
    return torch.from_numpy(x).cuda()

`

Hi, I modified the code as you pointed, It worked, Thanks a lot! But I find it run so slow, I use GeForce RTX 2080 Ti, Do you know how to implove it , Thanks! Sow

lisishen avatar Mar 19 '20 13:03 lisishen

CUDA on windows is known to be slower than that on linux, what's your gpu utility rate?

Sandbox3aster avatar Jul 18 '20 04:07 Sandbox3aster

Use Linux, CUDA on Windows is a headache.

pablodz avatar Aug 12 '20 03:08 pablodz

and

models.py First aid This arrangement is a copy of predict.py `

def get_input(self, data):
    img = data['a']
    inputs = img
    img = data['b']
    targets = img
    #inputs, targets = inputs.cuda(), targets.cuda()
    return self.array_to_batch(inputs), self.array_to_batch(targets)

def array_to_batch(self, x):
    #x = np.transpose(x, (2, 0, 1))
    x = np.expand_dims(x, 0)
    return torch.from_numpy(x).cuda()

`

hi in which file do you make this changes??

mhfatemi avatar May 20 '22 11:05 mhfatemi