Categories
Misc

How to attach normalization layer after training?

So I apply preprocessing on my dataset because I can generate new data/do normalization.
Now its time to save model, so someone else can use it. Now I need normalization.

model = Sequential()

//model.add(Lambda(lambda x: (x / 255.0) ))

model.add(…)
model.fit()

I want to attach this commented Layer before saving model. I didn’t need it for training but now
once model is trained I want to have normalization in network.
From this tutorial it is mention it is possible but I don’t see how to do this.

https://www.tensorflow.org/tutorials/images/data_augmentation

  • In this case the prepreprocessing layers will not be exported with the model when you call model.save
    . You will need to attach them to your model before saving it or reimplement them server-side. After training, you can attach the preprocessing layers before export.

submitted by /u/rejiuspride
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *