sahal mulki
sahal mulki

Reputation: 88

Reducing the size of a tensorflow model file

I have an TensorFlow model which basically classifies stuff into X-rays and Not X-rays.

My problem is that the TensorFlow model file(for that model) is a whopping 123mb big, and I need to reduce the size of it somehow.

I saw an answer here on Stack Overflow which had the exact code for what I needed to do, but only in Tensorflow 1.0.

So if anyone here could give me the updated TensorFlow 2.0 code, I would appreciate it a lot.

Python Version : Python 3.8.7

TensorFlow on my Laptop: TensorFlow 2.4

TensorFlow on the server I am hosting the app on : TensorFlow-CPU 2.2.0

Upvotes: 0

Views: 431

Answers (1)

Ssss Fjdj
Ssss Fjdj

Reputation: 21

dense layers need large size in the stored model. Use more conv layers and less dense layers. in model.summary() you see how many parameters are stored for each layer

Upvotes: 2

Related Questions