Skip to content

about SGRAN test mode #2

@dgerin

Description

@dgerin

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 :

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 :

CUDA_VISIBLE_DEVICES=0 python ./test.py --option ./options/test/SRGAN_x4.json

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions