Random.InvalidDType问题的解决办法
问题现象描述
测试程序onnxruntime_test_all提示Random.InvalidDType用例失败。
关键过程、根本原因分析
不同环境平台下,错误信息字符串内容不完全一致引发断言失败。
ONNX Runtime预期错误信息:“Attribute dtype does not specify a valid type in .”。
环境给出的实际错误信息:“Attribute dtype does not specify a valid type.”(少了“in .”)。
结论、解决方案及效果
- 打开“/path/to/ONNX_Runtime/onnxruntime/test/providers/cpu/generator/random_test.cc”文件。
vi /path/to/ONNX_Runtime/onnxruntime/test/providers/cpu/generator/random_test.cc
- 按“:”进入命令行模式,并输入显示行数的命令set nu,再按“Enter”。
:set nu
- 按“i”进入编辑模式,将第181、197、213、229行的“Attribute dtype does not specify a valid type in .”改为“Attribute dtype does not specify a valid type.”。
- 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
- 重新编译并验证,请参见编译安装源码与运行和验证。
父主题: 故障排除