2021-10-30 用torch.fx后量化的bug记录

  • 报错:ValueError: input model must be a GraphModule, please run torch._fx.symbolic_trace on your model before using quantize_fx. Got type:<class ‘main.EVAL’>

原因:模型中有不是graph module的部分

解决方案:提供的torch._fx.symbolic_trace来看是哪个部分出问题了:

st = symbolic_trace(net)
print(st.graph)
print(st.code)
  • 报错:prepare_fx中assert isinstance(fn, FunctionType) AssertionError

原因:EVAL()对象不是FunctionType,不可调用

解决方案:只输入EVAL().model进行量化

  • 报错:RuntimeError: The archive ILSVRC2012_devkit_t12.tar.gz is not present in the root directory or is corrupted. You need to download it externally and place it in /mnt/OCR/ScriptId/imagenet.

原因:从服务器上拉下来的imagenet数据集格式与demo中的imagenet的数据集格式不匹配

解决方案:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值