666DZY666 / micronet

micronet, a model compression and deploy lib. compression: 1、quantization: quantization-aware-training(QAT), High-Bit(>2b)(DoReFa/Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference)、Low-Bit(≤2b)/Ternary and Binary(TWN/BNN/XNOR-Net); post-training-quantization(PTQ), 8-bit(tensorrt); 2、 pruning: normal、regular and group convolutional channel pruning; 3、 group convolution structure; 4、batch-normalization fuse for quantization. deploy: tensorrt, fp32/fp16/int8(ptq-calibration)、op-adapt(upsample)、dynamic_shape
MIT License
2.22k stars 479 forks source link

torch round error #82

Open Jzz24 opened 3 years ago

Jzz24 commented 3 years ago

https://github.com/666DZY666/micronet/blob/096d9911b92aec9c52a5ddf1d8d694c32f345111/micronet/compression/quantization/wqaq/iao/quantize.py#L135

比如input = -2.5, image 感觉需要添加一个判断 tensor[tensor < 0] = torch.ceil(tensor[tensor < 0] - 0.5)

666DZY666 commented 3 years ago

nice~ fixed, https://github.com/666DZY666/micronet/commit/27fafff83ced2e1c955fc62d514606a045e68b09 测试了下,这样快一些。