본문 바로가기
반치용/문제해결(trouble shooting)

딥러닝 세팅하기(cudart64_101.dll 해결, 텐서플로 및 파이토치)

by  반  2020. 4. 7.

목표 : 윈도우에서 아나콘다를 이용해  jupyter / tensorflow / pytorch 풀 세팅

1. 그래픽카드 드라이브 설치(최신으로)
(아래 링크에서 해당 그래픽카드 선택 후 받아서 설치)
https://www.nvidia.co.kr/Download/index.aspx?lang=kr

2. cuda 설치 (10.2 설치해도 된다.)
<!비전 관련 설치를 할거라면 Visual studio 2015/2017/2019 커뮤니티 버전을 먼저 설치!>
(윈도우 10일 때 아래 링크 파일)
http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_441.22_win10.exe


[중요] cudart64_101.dll 문제 해결

	C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin
	폴더에서

1.
	cudart64_102.dll
	파일을 복제한 후

2.
	cudart64_101.dll
	으로 이름을 바꿔준다.

3. Cudnn 10.2 설치

4. visual c++ redistributable 설치 (2019 깔면 됨.)
https://visualstudio.microsoft.com/ko/thank-you-downloading-visual-studio/?sku=Community&rel=16#

5. python / ananconda 전부 제거
 시작(윈도우 버튼) -> 프로그램 추가/제거 에서 제거

6. anaconda 설치
https://repo.anaconda.com/archive/Anaconda3-2020.02-Windows-x86_64.exe

7. 아나콘다 업데이트
( 윈도우키 -> anaconda 치면 -> anaconda prompt 선택 후 아래 명령어 쓰면 됨  )

conda update -n base conda

8. tensorflow 설치
( 그대로 anaconda prompt에서 하면 됨, 어지간하면 처음 하나로 됨 )

conda install tensorflow==2.1.0



안되면 (ERROR:root:Internal Python error in the inspect module. 같은 거)
pip install tensorflow-gpu==2.0.0

그래도 안되면
pip uninstall tensorflow 등으로 지운 후

pip install tensorflow-gpu

9. pytorch 설치
( 마찬가지로 anaconda prompt에서 하면 됨)

conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

10. 확인

 1) 그대로 anaconda prompt

 2) jupyter lab 을 친 다음 엔터
(취향에 따라 jupyter notebook)

 3) tensorflow 설치 확인 & gpu 사용가능 여부 확인
( python 노트북 생성 후 아래 코드 입력 / 실행 )

import tensorflow as tf
print(tf.__version__)
tf.config.experimental.list_physical_devices(device_type=None)

 >> 위와 같이 치고 shift + enter 누르면 아래와 같이 나옴

이렇게 나오면 성공!

 4) pytorch 설치 확인 & gpu 사용가능 여부

import torch
print(torch.__version__)
torch.cuda.is_available()

이렇게 나오면 성공!
칸이 없으면 + 버튼 / 실행은 ▶ 버튼 누르면 됩니다.

ps. 가상환경에서 할 경우에는

1) 가상환경 만들기
2) 가상환경 실행
3) 8,9번 가상환경에서 진행
4) 10번 kernel -> change kernel 한 후 해당 가상환경 선택한 후 코드실행

댓글