New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print_qstats(): operation type issue with Sequential() model #39
Comments
@danielemoro please take a look. thanks |
Hi @HaoranREN, |
@lishanok Thanks a lot for your explanations 👍 |
@HaoranREN I've been looking into your issue and created a fix. You should hopefully have access to it soon. The reason why you see The reason why this is happening in the Sequential API and not the Functional API is because the Input Layer in the Sequential API is "hidden" when iterating model layers, and so the tool does not cache the input bits that would be passed in to the first convolution layer. This is just a quirk of Keras, so the fix allows code needs to handle both situations. Thank you for bringing this to our attention, Daniele |
@danielemoro Thanks a lot for your response and it makes a lot of sense. I was also suspecting the Keras implementation, since like a said, it only happens to the first layer of the Sequential() model. |
…quential API Addresses the following GitHub issue: #39 PiperOrigin-RevId: 338105149 Change-Id: I389679aed80d9659b11c33ce0597c6935217f6a4
a fix was merged. close it. feel free to reopen it if you have any questions. |
When I was applying quantization on a Keras Sequential() model, I found that there could be an issue about the operation type in print_stats() function.
For example, with the model in example_mnist.py but coded by the Sequential() API, I got an output as below. The operation type for the first conv2d layer is
unull_4_-1
, whereas it issmult_4_8
with the functional API.Based on my experiments with some other models, this only happens to the first layer of the Sequential() model.
Also, for
smult_4_8
, I would like to know what does the8
stand for here?I am on:
tensorflow-gpu 2.2.0
tensorflow-model-optimization 0.4.1
The text was updated successfully, but these errors were encountered: