Skip to content
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

TensorRT统计blob直方图 #11

Open
zhangfeixiang222 opened this issue Mar 25, 2021 · 0 comments
Open

TensorRT统计blob直方图 #11

zhangfeixiang222 opened this issue Mar 25, 2021 · 0 comments

Comments

@zhangfeixiang222
Copy link

您好,在TensorRT中,我的理解是[-max, max] 量化为[-127, 127].
可在TensorRT激活值量化部分,也就是tools/caffe_quanttable_e2e.py收集直方图的部分:
print("\nCollect histograms of activations:")
for i, image in enumerate(images_files):
net_forward(net, image, transformer)
for layer in quantize_layer_lists:
blob = net.blobs[layer.blob_name].data[0].flatten()
blob= blob[blob > 0]
layer.initial_histograms(blob)
if i % 100 == 0:
print("loop stage 2 : %d/%d" % (i, len(images_files)))
为什么只收集blob>0的部分呢,如果卷积后面没有ReLU的情况怎么处理呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant