在大多数情况下,在所有作系统上,安装 ML.NET 与引用相应的 NuGet 包一样简单。
dotnet package add Microsoft.ML
但在某些情况下,还有其他安装要求,尤其是在需要本机组件时。 本文介绍这些情况的安装要求。 这些部分按具有附加依赖项的特定 Microsoft.ML.*
NuGet 包细分。
Microsoft.ML.TimeSeries,Microsoft.ML.AutoML
这两个包都有对Microsoft.ML.MKL.Redist
的依赖,而Microsoft.ML.MKL.Redist
又依赖于libomp
。
无需执行额外的安装步骤。 将 NuGet 包添加到项目时,会安装该库。
安装存储库的 GPG 密钥:
sudo bash
# <type your user password when prompted. this will put you in a root shell>
# cd to /tmp where this shell has write permission
cd /tmp
# now get the key:
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
# now install that key
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
# now remove the public key file exit the root shell
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
exit
为 MKL 添加 APT 存储库:
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
请更新软件包:
sudo apt-get update
安装 MKL:
sudo apt-get install <COMPONENT>-<VERSION>.<UPDATE>-<BUILD_NUMBER>
例如:
sudo apt-get install intel-mkl-64bit-2020.0-088
确定 libiomp.so
的位置:
find /opt -name "libiomp5.so"
例如:
/opt/intel/compilers_and_libraries_2020.0.166/linux/compiler/lib/intel64_lin/libiomp5.so
将此位置添加到加载库路径:
sudo ldconfig /opt/intel/compilers_and_libraries_2020.0.166/linux/compiler/lib/intel64_lin
使用命令 Homebrew
安装库:
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb && brew install ./libomp.rb && brew link libomp --force