Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not reproduce the result #1

Open
ceo1207 opened this issue Mar 5, 2019 · 2 comments
Open

can not reproduce the result #1

ceo1207 opened this issue Mar 5, 2019 · 2 comments
Assignees

Comments

@ceo1207
Copy link

ceo1207 commented Mar 5, 2019

i run this code to train a model twice, each time use 1w+ iterations.
But i can not reproduce the result of the paper. when i visualize the result, the result is terriable.

is there something wrong?
i just rescale and clip the result, but when i see the result, it just like a Color Inverted image. I try to change the order of the result, it does not work.

def show_img(img_data):
    img_data = np.squeeze(img_data)
    # img_data = img_data[:,:,::-1]
    img_data = img_data*255
    img_data = img_data.astype("int")
    img_data = np.clip(img_data, 0, 255)
    plt.imshow(img_data)
    plt.show()
def show_result(model, device):
    files_path  = "/home/ceo1207/Datasets/sr_test/Set5/"
    files = os.listdir(files_path)
    for item in files:
        img_array = np.asarray(Image.open(os.path.join(files_path, item)))
        plt.imshow(img_array)
        plt.show()
        img_array = img_array.transpose((2, 0, 1))
        img_array = img_array[np.newaxis, :, :, :]
        img_array = img_array.astype("float32") / 255.0
        x = torch.from_numpy(img_array).float()
        x = x.to(device)
        y_fake = model.gen_g(x)
        # y_fake.detach().cpu().numpy().transpose(0, 2, 3, 1)
        y_fake = y_fake.detach().cpu().numpy().transpose(0, 2, 3, 1)
        show_img(y_fake)
@shadow2496 shadow2496 self-assigned this Mar 31, 2019
@shadow2496
Copy link
Owner

shadow2496 commented Mar 31, 2019

First of all, sorry for the late reply.

The problem of result images you mentioned is the one that we are frequently facing as well.
Though it is not included in the paper, we consider the absence of the content consistency loss in the target domain Y (DSLR-quality) as the most plausible cause of the problem and are planning to update the repo in several weeks so that the model can reach an ideal optimum.
Currently, we are focusing on improving the readability of our code and error checking, since we can't completely exclude coding mistakes from causes.

If you have any other ideas or suggestions about the problem, please share with us.
Thank you.

@jxust01
Copy link

jxust01 commented Mar 6, 2022

Are discriminators not frozen when training generators?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants