在使用nni 工具对PyTorch 模型进行剪枝的时候,出现了如下的 Runtime Error,查询并解决后,记录在此,给出现相同错误的人一个参考。
RuntimeError: 0 INTERNAL ASSERT FAILED at /opt/conda/conda-bld/pytorch_1587428398394/work/torch/csrc/jit/ir/alias_analysis.cpp:318, please report a bug to PyTorch. We don’t have an op for aten::to but it isn’t a special case. Argument types: Tensor, None, int, Device, bool, bool, bool, int,
代码以及环境如下:
'''
python 3.7
pytorch 1.5.0
nni 2.3
'''
pruner = FPGMPruner(net_stu.module, config_list,dependency_aware=True