Question

I am training a deep-learning style transfer model with the pretrained-VGG19 CNN.

My aim is to use it in my Android app for personal purposes with Google Firebase Machine Learning Kit (which would host my .H5 model to make it usable by my Android app). The maximum .H5 model file's size allowed by Machine Learning Kit is: 8MB. However when I save the whole VGG19 model, I end with 80MB... So I can't use it.

Since only some layers of the VGG19 network are used in my style transfer program, is it possible to reduce the .H5's size by saving only those layers' weights, or something like that? Is there any other solution to my problem?

To save my VGG19 network as a .H5 file, I use the following Python command:

model.save('./style_transfer/st.h5', include_optimizer=False) , where model = vgg19.VGG19(input_tensor=input_tensor, weights='imagenet', include_top=False).

As you can see, I already don't include the optimizer in order to reduce the saved .H5's size.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with datascience.stackexchange
scroll top