Closed hexists closed 4 years ago
multi processing 으로 인한 오류인지 확인하고, 해결 방법을 찾아봅니다.
동일한 코드를 실행하는 경우, 몇가지 오류를 출력합니다.
환경 변수 설정 오류
objc[47789]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[47789]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[47790]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[47790]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
입력 데이터가 빈 경우(NaN)
Concurrent tagging:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "./test_mt.py", line 17, in do_concurrent_tagging
l = [k.pos(lines[i]) for i in range(start, end)]
File "./test_mt.py", line 17, in <listcomp>
l = [k.pos(lines[i]) for i in range(start, end)]
File "/usr/local/lib/python3.7/site-packages/konlpy/tag/_kkma.py", line 55, in pos
sentences = self.jki.morphAnalyzer(phrase)
TypeError: No matching overloads found for kr.lucypark.kkma.KkmaInterface.morphAnalyzer(float), options are:
public java.util.List kr.lucypark.kkma.KkmaInterface.morphAnalyzer(java.lang.String) throws java.lang.Exception
filt_condition = dataset['document'].str.contains("", na=False)
dataset = dataset[filt_condition]
입력 데이터 분석에 오랜 시간이 걸리는 경우(OOM이 나거나 계속 실행됩니다.)
Traceback (most recent call last):
File "./test_mp.py", line 69, in <module>
results = pool.map(morphRow, dataset.iloc[:, 0].values)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
multiprocessing.pool.MaybeEncodingError: Error sending result: '<multiprocessing.pool.ExceptionWithTraceback object at 0x114512b70>'. Reason: 'PicklingError("Can't pickle <java class 'java.lang.OutOfMemoryError'>: attribute lookup java.lang.OutOfMemoryError on konlpy.tag._kkma failed",)'
진짜 조낸 재밌다 굿굿굿굿굿굿굿굿굿굿굿굿굿굿굿굿굿굿굿굿굿굿
몰라 그냥 영화도 안봤는데 쓰레기얌 ㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂㅂ
황시욬황시욬황시욬황시욬황시욬황시욬황시욬황시욬황시욬황시욬
ㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁㄹㅇㄴㅁ
멀티프로세싱 코드를 확인하면서 참고했던 링크들입니다.
공식 문서, 멀티프로세싱 예제
okt 멀티 프로세싱 관련
konlpy 잦은 문제 해결 방법
꼬꼬마 oom
꼬꼬마
$ time java -jar kkma-2.1.jar err_sample.txt
konlpy multiprocessing 실험