yiyang7 / super_resolution_with_cnns_and_gans Goto Github PK
View Code? Open in Web Editor NEWImage Super-Resolution Using SRCNN, DRRN, SRGAN, CGAN in Pytorch
Image Super-Resolution Using SRCNN, DRRN, SRGAN, CGAN in Pytorch
Under which open-source license are you releasing this software and the trained weights ?
I cannot find a License file within the repository.
Thank you for clearing this up
what is the dataset directory?
hey i'm trying to load image 128x128 and i have resized it into 64x64 in data_loader but i still get this error
Traceback (most recent call last):
File "train_gan.py", line 245, in
args.restore_file,cuda_id=cuda_id)
File "train_gan.py", line 127, in train_and_evaluate
train(netG, netD, optimG, optimD, loss_fn, train_dataloader, metrics, params, cuda_id)
File "train_gan.py", line 66, in train
g_loss = loss_fn(fake_out, fake_img, real_img)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "F:\ProgramTA\CGAN_AinilMardiah\program\loss.py", line 78, in forward
perception_loss = self.mse_loss(self.loss_network(out_images), self.loss_network(target_images))
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\loss.py", line 421, in forward
return F.mse_loss(input, target, reduction=self.reduction)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\functional.py", line 1716, in mse_loss
return _pointwise_loss(lambda a, b: (a - b) ** 2, torch._C._nn.mse_loss, input, target, reduction)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\functional.py", line 1674, in _pointwise_loss
return lambd_optimized(input, target, reduction)
RuntimeError: input and target shapes do not match: input [16 x 512 x 8 x 8], target [16 x 512 x 2 x 2] at c:\programdata\miniconda3\conda-bld\pytorch_1532505617613\work\aten\src\thcunn\generic/MSECriterion.cu:12
could help me how to solve the error?
Both SRGAN and CGAN's size of best_d.pth.tar are 0. Maybe the file was broken?
The link cannot be opened
I think if loss_D is 0, it is that discriminator can easy to make a distinction between real image and fake image, and this is not good, so why SRGAN loss_D is 0?
Traceback (most recent call last):
File "train_gan.py", line 271, in
train_and_evaluate(netG, netD, train_dl, val_dl, optimG, optimD, loss_fn, metrics, params, opt.model_dir, opt.restore_file,cuda_id=cuda_id)
File "train_gan.py", line 142, in train_and_evaluate
train(netG, netD, optimG, optimD, loss_fn, train_dataloader, metrics, params, cuda_id)
File "train_gan.py", line 75, in train
fake_out = netD(fake_img).mean()
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "F:\ProgramTA\CGAN_AinilMardiah\program\model\cgan.py", line 100, in forward
return torch.sigmoid(self.net(x).view(batch_size))
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\container.py", line 91, in forward
input = module(input)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\modules\activation.py", line 447, in forward
return F.leaky_relu(input, self.negative_slope, self.inplace)
File "C:\Users\PC\Anaconda3\envs\cgan\lib\site-packages\torch\nn\functional.py", line 755, in leaky_relu
return torch._C._nn.leaky_relu(input, negative_slope)
RuntimeError: CUDA error: out of memory
I have tried to reduce batch size but i still get this error, could you help me how to resolve this error?
in train_gan.py file
in line 15 there should be :
from evaluate_gan import evaluate
instead of "from evaluate import evaluate"
Otherwise, there will be an import error
I want to save the result image. .So, what is the data structure of output_batch ? I don't know how to writte the code ? can you writte it ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.