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

无法dump resnet50的量化模型 #88

Closed
qq332982511 opened this issue Jan 23, 2021 · 1 comment · Fixed by #89
Closed

无法dump resnet50的量化模型 #88

qq332982511 opened this issue Jan 23, 2021 · 1 comment · Fixed by #89

Comments

@qq332982511
Copy link

环境

1.系统环境:
2.MegEngine版本:
3.python版本:python3.7
4.模型名称:

复现步骤

请提供关键的代码片段便于追查问题

python3 inference.py -a resnet50 --mode quantized --dump

请提供完整的日志及报错信息

Traceback (most recent call last):
File "inference.py", line 110, in
main()
File "inference.py", line 50, in main
model = models.dictargs.arch
File "/home/liujunjie/AIBenchmark/models/model-zoo/megengine_quant/quantization/models/resnet.py", line 296, in resnet50
m = ResNet(Bottleneck, [3, 4, 6, 3], **kwargs)
File "/home/liujunjie/AIBenchmark/models/model-zoo/megengine_quant/quantization/models/resnet.py", line 162, in init
self.layer1 = self._make_layer(block, 64, layers[0], norm=norm)
File "/home/liujunjie/AIBenchmark/models/model-zoo/megengine_quant/quantization/models/resnet.py", line 235, in _make_layer
norm=norm,
TypeError: init() got an unexpected keyword argument 'norm'

@qq332982511
Copy link
Author

https://github.com/MegEngine/Models/blob/master/official/quantization/models/resnet.py#L95
怀疑是class Bottleneck(M.Module)的init缺norm=M.BatchNorm2d, 参考https://github.com/MegEngine/Models/blob/master/official/quantization/models/resnet.py#L52 class BasicBlock(M.Module)的init虽然接受norm接口,但只起check的作用

zhouyizhuang-megvii added a commit to zhouyizhuang-megvii/Models that referenced this issue Jan 23, 2021
zhouyizhuang-megvii added a commit that referenced this issue Jan 23, 2021
* fix(quantization): add missing arg norm to BottleNeck

resolve #88

* fix(ci): 1.2 skip error for abstract method inheritance of Tensor
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

Successfully merging a pull request may close this issue.

1 participant