2013-12-12 4 views
4

최근에 Enthought Canopy 32 비트 및 Canopy 버전 1.1.0 (64 비트) 설치가 잘된 작업 복사본을 제거했습니다. 나는 모델 내 커널 충돌에 맞게 sklearn를 사용하려고, 나는 다음과 같은 오류가 발생하는 경우 : 동일한 코드는 숲의 32 비트에서 잘 실행중인sklearn OMP : 모델 번호 맞추기 중 오류 15 번.

The kernel (user Python environment) has terminated with error code 3. This may be due to a bug in your code or in the kernel itself. 

Output captured from the kernel process is shown below. 

OMP: Error #15: Initializing libiomp5md.dll, but found mk2iomp5md.dll already initialized. 
OMP: Hint: This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/. 

. 이 코드는 실제로 linear_model.SGDClassifier (loss = 'log')의 단순한 적합입니다 (Logistic Regression에 대한 동일한 오류, 다른 모델을 시도하지 않았습니다.)

어떻게 수정합니까?

+0

"import os; os.environ [ 'PATH']. split (';')"에서 무엇을 얻습니까? (외부 따옴표 생략) –

답변

0

나는 numpy와 캐노피의 충돌 설치에서 오는 동일한 문제가있었습니다. 글을 써서이 문제를 해결했습니다 :

import os 
os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE" 

우아한 해결책은 아니지만 저에게 도움이되었습니다.

+0

-1, 오류 메시지는 이것이 안전하지 않다고 명시합니다. '최선의 작업은 프로세스에 단일 OpenMP 런타임 만 연결되도록하는 것입니다. 모든 라이브러리에서 OpenMP 런타임의 정적 연결을 피할 수 있습니다. 안전하지 않고 지원되지 않는 문서화되지 않은 해결 방법으로 환경 변수 KMP_DUPLICATE_LIB_OK = TRUE를 설정하여 프로그램을 계속 실행할 수는 있지만 충돌로 인해 자동으로 잘못된 결과가 발생할 수 있습니다 .' – mbatchkarov