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

VGG weight file not available on AWS #12

Open
mixuala opened this issue Feb 6, 2020 · 4 comments
Open

VGG weight file not available on AWS #12

mixuala opened this issue Feb 6, 2020 · 4 comments

Comments

@mixuala
Copy link

mixuala commented Feb 6, 2020

got a FORBIDDEN response for the AWS file. switched to the weights file which is now included with torchvision

# !wget https://s3-us-west-2.amazonaws.com/jcjohns-models/vgg16-00b39a1b.pth
!wget https://download.pytorch.org/models/vgg16-397923af.pth
!cp vgg16-397923af.pth vgg16-00b39a1b.pth
@rrmina
Copy link
Owner

rrmina commented Feb 7, 2020

As far as I know, torchvision's VGG assumes RGB image input of pixel values [0,1] in contrast to the original VGG weights which assumes BGR image input with pixel values from [0,255].

Did that work out for you?

@rrmina
Copy link
Owner

rrmina commented Feb 7, 2020

Anyway, someone has already reported this issue to me. #10

I have uploaded the VGG16 weights here: https://drive.google.com/file/d/1a0sFcNEvmIy21PE0yp7tzJuU0vhhV0Ln/view?usp=sharing

I will also update the readme as well as the notebooks with the appropriate link.

Thank you for reporting.

@mixuala
Copy link
Author

mixuala commented Feb 8, 2020

It seems to work, here's a shot of my training just before the end (below) using the pytorch weights as mentioned

What I'm confused about is how your network successfully learns without clipping the Transformer output before calculating the VGG losses. I rebuilt the same network in tensorflow, but it doesn't learn unless I do the following transforms to the output of the Transformer

  • add back the VGG mean center values and
  • clip the output to domain=(0.,1.)
    I'm still working on it...

Screen Shot 2020-02-08

@rrmina
Copy link
Owner

rrmina commented Feb 8, 2020

Interesting! Looks like it somehow worked, though I never had a result with artifacts like yours in upper right corner.

I did add the VGG means

content_features = VGG(content_batch.add(imagenet_neg_mean))
generated_features = VGG(generated_batch.add(imagenet_neg_mean))

And yeah, I am also equally confused that I did not need to use a Tanh as output layer. In fact, Tanh produced really bad looking images . Search for Ditching in my README

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

2 participants