0

I use ImageDataGenerator .fit() to normalize training data. But then there is no elegant way to perform .standardize() on real when I deploy the model (different running code then training).

I realize I can extract the normalization params, save them somewhere and then perform the normalization myself but then it would be easier to write it myself to begin with.

Is there a way to this in the current design? Is there a way to do .standardize() long after the training code has completed?

Bambi
  • 123
  • 6
  • I could not understand what you mean exactly. Does [this solution](https://stackoverflow.com/a/51118955/2099607) work for you? – today Jul 03 '18 at 15:43
  • If you are actually working on a real problem-solution (rather then doing experimentation, self-learning or research), your production environment (where user data is sent to for inference) is likely very different then your training one. The production environment does not have `datagen` (the ImageDataGenerator instance) available, nor is it trivial to re-create it there. Then you need to carry the normalization parameters (and method?) there somehow (serialize them along with the model) and re-write `standardize` there. I would have expected the design to treat this concern somehow. – Bambi Jul 04 '18 at 20:54
  • In short, the solution above will not work because it assumes `datagen` is still available in inference time... – Bambi Jul 04 '18 at 21:00

0 Answers0