安装AMCT过程中,编译并安装自定义算子包时,出现"AttributeError: module 'onnxruntime' has no attribute 'SessionOption' "错误,编译过程中止,AMCT无法使用。
Python环境中的ONNX Runtime库异常或者版本不满足要求,没有SessionOption属性。
pip3 install --force-reinstall onnxruntime==1.x.x --user
造成ONNX Runtime未正确安装的原因可能是用户同时安装了onnxruntime和onnxruntime_gpu,卸载其中一个版本,导致另一个也无法正常使用。