ZLkanyo009 / MQBench_Quantize

QAT(quantize aware training) for classification with MQBench
MIT License
34 stars 3 forks source link

run error #2

Open mathpopo opened 2 years ago

mathpopo commented 2 years ago

stty: 标准输入: 对设备不适当的 ioctl 操作 Traceback (most recent call last): File "/home/chenxin/disk1/github/MQBench_Quantize/main.py", line 21, in from utils import progress_bar, choose_model, choose_backend File "/home/chenxin/disk1/github/MQBenchQuantize/utils.py", line 49, in , term_width = os.popen('stty size', 'r').read().split() ValueError: not enough values to unpack (expected 2, got 0)

mathpopo commented 2 years ago

use https://github.com/WuJie1010/Facial-Expression-Recognition.Pytorch/issues/1 can run

but

Traceback (most recent call last): File "/home/chenxin/disk1/github/MQBench_Quantize/main.py", line 170, in net = choose_model(args) File "/home/chenxin/disk1/github/MQBench_Quantize/utils.py", line 152, in choose_model return ShuffleNetG2() File "/home/chenxin/disk1/github/MQBench_Quantize/models/shufflenet.py", line 92, in ShuffleNetG2 return ShuffleNet(cfg) File "/home/chenxin/disk1/github/MQBench_Quantize/models/shufflenet.py", line 61, in init self.layer1 = self._make_layer(out_planes[0], num_blocks[0], groups) File "/home/chenxin/disk1/github/MQBench_Quantize/models/shufflenet.py", line 71, in _make_layer layers.append(Bottleneck(self.in_planes, out_planes-cat_planes, stride=stride, groups=groups)) File "/home/chenxin/disk1/github/MQBench_Quantize/models/shufflenet.py", line 29, in init self.conv1 = nn.Conv2d(in_planes, mid_planes, kernel_size=1, groups=g, bias=False) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 388, in init False, _pair(0), groups, bias, padding_mode) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 107, in init out_channels, in_channels // groups, *kernel_size)) TypeError: new() received an invalid combination of arguments - got (float, int, int, int), but expected one of:

Process finished with exit code 1

mathpopo commented 2 years ago

does mqbench0.02 version cannot support these?

main.py ShuffleNetV2 --quantize ==> Preparing data.. Files already downloaded and verified Files already downloaded and verified ==> Building model.. [MQBENCH] INFO: Quantize model using BackendType.Tensorrt scheme. [MQBENCH] INFO: Weight Qconfig: FakeQuantize: LearnableFakeQuantize Params: {} Oberver: MinMaxObserver Params: Symmetric: True / Bitwidth: 8 / Per channel: True / Pot scale: False [MQBENCH] INFO: Activation Qconfig: FakeQuantize: LearnableFakeQuantize Params: {} Oberver: EMAMinMaxObserver Params: Symmetric: True / Bitwidth: 8 / Per channel: False / Pot scale: False Traceback (most recent call last): File "/home/chenxin/disk1/github/MQBench_Quantize/main.py", line 201, in net = prepare_qat_fx_by_platform(net, backend) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/MQBench-0.0.2-py3.7.egg/mqbench/prepare_by_platform.py", line 257, in prepare_qat_fx_by_platform File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 605, in symbolic_trace graph = tracer.trace(root, concrete_args) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 354, in trace self.create_node('output', 'output', (self.create_arg(fn(args)),), {}, File "/home/chenxin/disk1/github/MQBench_Quantize/models/shufflenetv2.py", line 124, in forward out = self.layer1(out) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 343, in module_call_wrapper return self.call_module(mod, forward, args, kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 222, in call_module return forward(args, kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 339, in forward return _orig_module_call(mod, *args, *kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/modules/container.py", line 119, in forward input = module(input) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 343, in module_call_wrapper return self.call_module(mod, forward, args, kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 222, in call_module return forward(*args, kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 339, in forward return _orig_module_call(mod, *args, *kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "/home/chenxin/disk1/github/MQBench_Quantize/models/shufflenetv2.py", line 49, in forward x1, x2 = self.split(x) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 343, in module_call_wrapper return self.call_module(mod, forward, args, kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 222, in call_module return forward(*args, kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/fx/symbolic_trace.py", line 339, in forward return _orig_module_call(mod, *args, *kwargs) File "/home/chenxin/disk1/anaconda3/envs/MQBench_Quantize/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "/home/chenxin/disk1/github/MQBench_Quantize/models/shufflenetv2.py", line 28, in forward c = int(x.size(1) * self.ratio) TypeError: int() argument must be a string, a bytes-like object or a number, not 'Proxy'

Process finished with exit code 1