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

int8量化的时候,输入是多个,怎么修改呢? calib_shape = [calib_batch_size] + list(inputs[0].shape[1:])不对吧 #119

Open
henbucuoshanghai opened this issue Jan 15, 2024 · 4 comments

Comments

@henbucuoshanghai
Copy link

.exists(calib_cache):
calib_shape = [calib_batch_size] + list(inputs[0].shape[1:])
calib_dtype = trt.nptype(inputs[0].dtype)
self.config.int8_calibrator.set_image_batcher(
ImageBatcher(calib_input, calib_shape, calib_dtype, max_num_images=calib_num_images,
exact_batches=True))

calib_shape = [calib_batch_size] + list(inputs[0].shape[1:])
如果多输入,怎么办呢?此处。。不太懂

@henbucuoshanghai
Copy link
Author

感谢感谢

@Linaom1214
Copy link
Owner

一个简单的方法,合并多个输入,在forward里边split

@henbucuoshanghai
Copy link
Author

输入维度不一致,那就展开为一维?多个输入挨个拼接,?forward的时候切开后维度变回去?

@henbucuoshanghai
Copy link
Author

另外多个输入不是图片,那就需要把这些变量保存起来,然后int8量化的时候读取?

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

2 participants