You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to perform a test phase on the SGRAN.
I downloaded the SGRAN pretrained model at your link : https://drive.google.com/file/d/1vAtPLGbdyt--SZQxUl0YKPRQgu6-kR6v/view, and set il all up on my local env.
While reading the README, i was sure that the bench support testing for SGRAN
but when I inspect the sources, my understanding is that "test mode" is only available
for SRResNet.
In model.py below, It is clear that sr_gan is only loaded for "training mode" , isn't it :
def create_model(opt):
if opt.model == 'sr_resnet':
from .sr_resnet_model import SRResNetModel
model = SRResNetModel()
elif opt.model == 'sr_resnet_test':
from .sr_resnet_test_model import SRResNetTestModel
model = SRResNetTestModel()
elif opt.model == 'sr_gan':
from .sr_gan_model import SRGANModel
model = SRGANModel()
else:
raise NotImplementedError('Model [%s] not recognized.' % opt.model)
model.initialize(opt)
print('Model [%s] is created.' % model.name())
return model
In addition, when I execute the cmd below, I got a crash that tells me again that test mode is not supported got SRGAN :
Traceback (most recent call last):
File "./test.py", line 45, in <module>
model = create_model(opt)
File "/home/dgerin/SRGAN-PyTorch/models/models.py", line 17, in create_model
model.initialize(opt)
File "/home/dgerin/SRGAN-PyTorch/models/sr_gan_model.py", line 20, in initialize
assert opt.is_train
Could you give more information about that ?
Thanks,
Dimitri
The text was updated successfully, but these errors were encountered:
Hello,
Please, I now a bit more advanced in my understanding of the flow.
In fact, I previously just misunderstood that for SRGAN, the D net is only used for training.
It appears clearly, when reading the code and option file that for the SRGAN,
we have the D net and the G net, but for the G net, we (sould) use the SRResnet G net.
When we zoom into sr_gan_model.py, and in networks.py :
# Always define netG
self.netG = networks.define_G(opt) # Should use model "sr_resnet"
# Pick the corresponding model for Generator and initialize it.
def define_G(opt):
gpu_ids = opt.gpu_ids
opt = opt.network
which_model = opt.which_model_G
if which_model == 'sr_resnet':
netG = G.SRResNetGenerator(input_ngc=opt.input_ngc, output_ngc=opt.output_ngc, ngf=opt.ngf, ngb=opt.ngb, norm_type=opt.norm_type)
elif which_model == 'sr_gan':
netG = G.SRGANGenerator(input_ngc=opt.input_ngc, output_ngc=opt.output_ngc, ngf=opt.ngf, ngb=opt.ngb, norm_type=opt.norm_type)
else:
raise NotImplementedError('Generator model [%s] is not recognized' % which_model)
netG = nn.DataParallel(netG, device_ids=gpu_ids)
return netG
, this is confusing, because G.SRGANGenerator is not implement in the G module import models.modules.generator as G
What I'm finally trying to clarify is if there are differences (in topology, tensor shapes, kernel sizes, etc..) between G.SRResNetGenerator and
the not implemented G.SRGANGenerator ?
Hello twhui,
I would like to perform a test phase on the SGRAN.
I downloaded the SGRAN pretrained model at your link : https://drive.google.com/file/d/1vAtPLGbdyt--SZQxUl0YKPRQgu6-kR6v/view, and set il all up on my local env.
While reading the README, i was sure that the bench support testing for SGRAN
but when I inspect the sources, my understanding is that "test mode" is only available
for SRResNet.
In model.py below, It is clear that sr_gan is only loaded for "training mode" , isn't it :
In addition, when I execute the cmd below, I got a crash that tells me again that test mode is not supported got SRGAN :
CUDA_VISIBLE_DEVICES=0 python ./test.py --option ./options/test/SRGAN_x4.json
Could you give more information about that ?
Thanks,
Dimitri
The text was updated successfully, but these errors were encountered: