William
William

Reputation: 11

how to check the quantized weights in tflite files

When I quantized the model by lite modules in tensorflow, I cann't check the weights values that had quantized.Is there any way to view these values in the .tflite files? or Is there any way to parse the .tflite files?

Upvotes: 1

Views: 2760

Answers (2)

Aleksandr  Kondratyev
Aleksandr Kondratyev

Reputation: 501

here in first answer is guide, how to create json view of .tflite model. There you can see quantized values

Upvotes: 1

user10530640
user10530640

Reputation: 81

There are some neural network visualizers that can also provide an interface to inspect the file. I have been using Netron. You can click on the "weights" tab of the layer you are interested in to view the data. I haven't tried it yet, but there appears to be a floppy-disk save icon when you view weights/biases in the right side-bar.

The data format is a Google FlatBuffer, defined by the schema file here. You may prefer doing this if you want to do something with the data like output it in a different format. I found the output from parsing it myself using the schema.fbs file to match Netron's for the CNN's I passed in. You can check out the FlatBuffers documentation here.

Upvotes: 3

Related Questions