说明:该解决方法不具有普遍性
python: symbol lookup error: /opt/conda/envs/lh/lib/python3.9/site-packages/mkl/../../../libmkl_intel_thread.so.1: undefined symbol: __kmpc_global_thread_num
在模型运行过程中报如上错误,定位到了 mkl
这个包,去 pypi 查了一下该库的说明,对该库的说明如下:
Intel® oneAPI Math Kernel Library (Intel® oneMKL) is a computing math library of highly optimized, extensively threaded routines for applications that require maximum performance. This package provides C and Data Parallel C (DPC ) programming language interfaces. Intel MKL C language interfaces can be called from applications written in either C or C , as well as in any other language that can reference a C interface. Use it to optimize code for current and future generations of Intel® CPUs and GPUs.
推测在程序运行过程中,调用的包直接存在某些不兼容的情况,使用 conda update mkl
命令更新了mkl及其相关的包,成功解决了该问题。