STUDY(공개)/python

230507) 딥러닝 gpu 환경 구성하기

모코코마을 2023. 5. 6.

목차

그... 글을 쓰는 이유는 환경 설정단계부터 오류나서 메모용..
# FutureWarning: In the future 'np.object will be defined as the corresponding NumPy scalar.'
# TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
 
모,,,/// 새로운 가상환경 만드는 김에 절차 상기하는 겸, 내가 다음에 편히 설정할 수 있게 하는 목적
 
 
# 관련 포스팅
KT 에이블스쿨 3기 DX반 8주차 - 딥러닝, 시각지능 딥러닝
 
==========================================
# 버전 확인
python 3.8.0
tensorflow 2.6.0
cuda 11.1
cuDNN v8.1.1 for CUDA 11.1
Visual Studio 2019

torch 1.9.1

torchvision 0.10.1

torchaudio 0.9.1

* numpy 1.23.4 *
* protobuf 3.20 *

==========================================
# anaconda prompt 실행코드
conda create -n NLP python=3.8.0
conda activate NLP

conda install keras
conda install -c conda-forge tensorflow==2.7.0

pip install torch==1.9.1 torchvision==0.10.1 torchaudio==0.9.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html --user

pip install jupyter lab
pip install ipykernel
pip install numpy==1.23.4
python -m ipykernel install --user --name NLP --display-name NLP
jupyter lab


==========================================
# numpy 버전문제가 있어서 다운그레이드
pip install numpy==1.23.4

import numpy as np
print('Numpy Version :', np.__version__)

 
==========================================
# protobuf 버전문제가 있어서 다운그레이드
pip install protobuf==3.20.0


 
==========================================
# GPU 확인

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

 
 

728x90

댓글