我有一个经过训练的onnx模型,需要量化到INT8。但我希望我的最后一个完全连接的层仍然在FP32或FP16中。那么,我如何选择特定的层来量化(或不量化)?
当我使用NNCF时,我只使用parametr ignored_scopes。也许在工作台上有类似的东西吗?
发布于 2022-11-10 07:46:01
在配置文件中使用“忽略”参数,从优化中排除节点或操作类型。
"algorithms": [
{
"name": "DefaultQuantization", // Optimization algorithm name
"params": {
"ignored": {
// List of nodes that are excluded from optimization
"scope": [
"<NODE_NAME>"
],
// List of types that are excluded from optimization
"operations": [
{
"type": "<NODE_TYPE>",
// Includes excluding by attributes
"attributes": {
"<NAME>": "<VALUE>" // Lists of values is not included
}
},
{
"type": "<NODE_TYPE>" // Excluding only by type
}
]
}https://stackoverflow.com/questions/74371046
复制相似问题