openppl-public / ppq

PPL Quantization Tool (PPQ) is a powerful offline neural network quantization tool.
Apache License 2.0
1.45k stars 224 forks source link

ProgramEntrance_2.py 执行报错 #478

Open zt706 opened 1 year ago

zt706 commented 1 year ago

环境使用 stephen222/ppq:ubuntu18.04_cuda11.4_cudnn8.4_trt8.4.1.5 容器, 代码使用最新master 分支

[Warning] Compling Kernels... Please wait (It will take a few minutes). Traceback (most recent call last): File "ProgramEntrance_2.py", line 293, in dispatching = PFL.Dispatcher(graph=graph).dispatch( File "/workspace/ppq/ppq/scheduler/dispatchers.py", line 202, in dispatch quant_operations = search_engine.opset_matching( File "/workspace/ppq/ppq/IR/search.py", line 610, in opset_matching partial_matchings = self._opset_matching( File "/workspace/ppq/ppq/IR/search.py", line 484, in _opset_matching if ep_expr is not None and ep_expr(op): File "/workspace/ppq/ppq/scheduler/dispatchers.py", line 205, in ep_expr = lambda x: (x.type not in quant_types) or x.is_boundary, TypeError: argument of type 'method' is not iterable

ZhangZhiPku commented 1 year ago

这还是个挺核心的错误,用ProgramEntrance_1 不会有这个错误吗?好像都会调用到这个地方的

zt706 commented 1 year ago

这还是个挺核心的错误,用ProgramEntrance_1 不会有这个错误吗?好像都会调用到这个地方的

ProgramEntrance_1 不会报错

ZhangZhiPku commented 1 year ago

让我们偷偷发一下模型?

zt706 commented 1 year ago

你好,都是官方代码,模型默认是 resnet18

唯一改动是:https://github.com/openppl-public/ppq/blob/master/ProgramEntrance_2.py#L234 这里用 calibrationdataloader = [torch.zeros(size=[1,3,224,224]) for in range(32)]

ersong2022 commented 8 months ago

这个问题有解决了吗?我也遇到这个问题了

zhuleia commented 1 month ago

您好,这个bug解决了,我在QAT中遇到了这个bug