Home >Backend Development >Python Tutorial >What should I do if I get an error when importing caffe into python?

What should I do if I get an error when importing caffe into python?

coldplay.xixi
coldplay.xixiOriginal
2020-08-25 09:20:142007browse

The solution to the error when importing caffe into python: first install mkl in the system, the code is [conda remove mkl mkl-service]; then import caffe again, the code is [import caffe].

What should I do if I get an error when importing caffe into python?

Solution to the error when importing caffe into python:

Import caffe into python:

import caffe

An error occurred:

Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so.

If MKL is installed on the system, just add the MKL lib path to the environment variable.

If MKL is not installed on the system, the solution is as follows:

conda install nomkl numpy scipy scikit-learn numexpr
conda remove mkl mkl-service

Import caffe again:

import caffe

Congratulation! Import successful.

Related learning recommendations: python tutorial

The above is the detailed content of What should I do if I get an error when importing caffe into python?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn