- 报错: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的数据集格式不匹配
解决方案: