编译pytorch RuntimeError: fft: ATen not compiled with MKL support解决方法

编译pytorch RuntimeError: fft: ATen not compiled with MKL support解决方法

1.安装mkl相关pkg

conda install mkl_fft mkl mkl-include

2.找到mkl安装的路径,对于我是在/opt/conda/lib和/opt/conda/include下.(主要看libmkl_intel_lp64.so,libmkl_gnu_thread.so,libmkl_core.so这几个库的位置)

3.修改pytorch/cmake/Modules/FindMKL.cmake

SET(MKL_INCLUDE_DIR)
SET(MKL_LIBRARIES)

改为

SET(MKL_INCLUDE_DIR "/opt/conda/include")
SET(MKL_LIBRARIES "/opt/conda/lib/libmkl_intel_lp64.so;/opt/conda/lib/libmkl_gnu_thread.so;/opt/conda/lib/libmkl_core.so")

4.编译

python setup.py install

ref:
https://github.com/pytorch/pytorch/issues/24334#issuecomment-568794596
https://github.com/pytorch/pytorch/issues/19184#issuecomment-488068466

你可能感兴趣的:(框架,pytorch)