Skip to content

pre-trained vgg19 for paddlepaddle(contain vgg19.py vgg19.npy vgg19_model and vgg19_params)

Notifications You must be signed in to change notification settings

toddwyl/vgg19_paddlepaddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

VGG19 model for PaddlePaddle

The model is converted from Caffe model VGG_ILSVRC_19_layers_deploy.prototxt and VGG_ILSVRC_19_layers.caffemodel, using caffe2fluid.

*If you want to use the whole model for the program, you can use load_inference_model to load the model. 1.Download model and params.

.
├── vgg19_model
├── vgg19_params

2.Usage

  • Extract the tar in the inference_model/ dir
  • You can use directly:
program, feed_names, fetch_targets = fluid.io.load_inference_model('./VGG19_pd_model_param', 
					exe, 'vgg19_model', 'vgg19_params')

Advanced

If you want to just load the param and realize your own model to use and add the loss like me:

  • example:

(when I reimplement the SRGAN, the loss of Generator is three parts, g_loss = mse_loss + vgg_loss + g_gan_loss

I need the vgg_api in the g_program.:+1:

So you can just use the load param.

fluid.io.load_params(exe, "./vgg19_pd_params")
  • PS. The way I save the param in different files:
fluid.io.save_persistables(exe,'./save_para/', inference_program)

Thanks for oraoto! I refer his code which is converted the vgg16 for paddlepaddle.

About

pre-trained vgg19 for paddlepaddle(contain vgg19.py vgg19.npy vgg19_model and vgg19_params)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages