본문 바로가기
반응형

연구 노트/R Python76

빅데이터 - 탄소 자료 다중회귀 적용 데이터 추출 전단계 2016-2019 30분 간격 총 자료 2021. 11. 17.
CUBLAS_STATUS_ALLOC_FAILED 에러: E tensorflow/stream_executor/cuda/cuda_blas.cc:226] failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED 해결: 아래 구문을 통해서 GPU 메모리를 제한해 줘야 된다. config = tf.compat.v1.ConfigProto(gpu_options = tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=0.8) # device_count = {'GPU': 1} ) config.gpu_options.allow_growth = True session = tf.compat.v1.Session(config=config) tf.compat.v1.keras.backe.. 2021. 11. 17.
`Model.state_updates` will be removed in a future version. 에러: C:\Users\chpark\ANACON~1\lib\site-packages\keras\engine\training.py:2401: UserWarning: `Model.state_updates` will be removed in a future version. This property should not be used in TensorFlow 2.0, as `updates` are applied automatically. warnings.warn('`Model.state_updates` will be removed in a future version. ' 해결: 아래 라인 실행해 주면 에러 사라진다. config = tf.compat.v1.ConfigProto(gpu_options = tf.com.. 2021. 11. 17.
Matplotlib is currently using agg 에러: :1: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. 해결: import matplotlib 대신 import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt 를 써주면 된다. 참고: windows10 pycharm 사용 시 UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. plt.show() 오류 해결 (tistory.com) 2021. 11. 17.
`Model.state_updates` will be removed 에러: UserWarning: `Model.state_updates` will be removed in a future version. This property should not be used in TensorFlow 2.0, as `updates` are applied automatically. warnings.warn('`Model.state_updates` will be removed in a future version. 해결: 아래 라인 실행해 주면 에러 사라진다. config = tf.compat.v1.ConfigProto(gpu_options = tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=0.8) # device_count = {'GP.. 2021. 11. 17.
파이썬 이전 그림이 계속 나올 때 해결 plt.clf() plt.cla() plt.close() 또는 fig, axes = plt.subplots(nrows=2, ncols=2) axes[0, 1].clear() 출처: python - matplotlib.pyplot will not forget previous plots - how can I flush/refresh? - Stack Overflow 2021. 11. 17.
ConvergenceWarning: lbfgs failed to converge (status=1): 에러: ConvergenceWarning: lbfgs failed to converge (status=1): STOP: TOTAL NO. of ITERATIONS REACHED LIMIT. 해결: model = LogisticRegression(random_state=42) 을 model = LogisticRegression(random_state=42, solver='lbfgs', max_iter=100) 로 수정한다. 참고: python - ConvergenceWarning: lbfgs failed to converge (status=1): STOP: TOTAL NO. of ITERATIONS REACHED LIMIT - Stack Overflow 2021. 11. 17.
R 파이썬 윈도우에서 한글 깨질때 encoding은 OS 시스템 마다 다르다. linux 는 utf8 사용 windows 는 cp949 사용 해결 import pandas as pd df=pd.read_csv(infile, encoding='cp949') 참고 linux 에서는 encoding 을 설정할 필요가 없다. pandast to_csv() 보면 default: utf-8 이 이미 설정되어 있음. 2021. 11. 16.
ModuleNotFoundError: No module named ModuleNotFoundError: No module named 'sklearn' sklearn 모듈이 없다는 의미 즉, 모듈이 설치되어 있지 않기에, CONDA 모드에서 pip 로 설치해 주면 된다. Rstudio의 경우, 반드시 r-rectitulate 가상환경에서 설치해야. 자세한 내용은 아래 문서 참고 https://aeir.tistory.com/entry/ModuleNotFoundError-No-module-named-matplotlib ModuleNotFoundError: No module named 'keras' 인 경우, 'tensorflow'도 같이 설치해야 됨. 2021. 11. 16.
728x90