DeblurGANv2
DeblurGANv2 copied to clipboard
Problems in running under Windows
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?
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
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()
`
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!
CUDA on windows is known to be slower than that on linux, what's your gpu utility rate?
Use Linux, CUDA on Windows is a headache.
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??