Doarchive

[Colab] 기본세팅 본문

Computer Vision/Deep learning

[Colab] 기본세팅

오순발닦개 2021. 1. 27. 14:23

 

1.Gpu Setup

 

 

 

 

2. Mount Google drive

 

from google.colab import drive

drive.mount('/content/gdrive')

 

!ls

2. Install CUDA

 

//setting 확인

!/usr/local/cuda/bin/nvcc --version

 

 

//cuda 설치 (최신버전 까니까 컴파일이 안됨  이전버전 설치 할것 colab 환경은 리눅스기때문에  리눅스 버전을 다운 받아야함) 

!tar -xzvf gdrive/My\ Drive/darknet/cuDNN/cudnn-10.1-linux-x64-v7.6.5.32.tgz -C /usr/local/

!chmod a+r /usr/local/cuda/include/cudnn.h

 

 

!cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

 

2. Install DarkNet

 

//git clone

!git clone https://github.com/kriyeng/darknet/

%cd darknet

 

//git checkout

!git checkout feature/google-colab

 

//build

!make

 

//실행파일생성

import os

if not os.path.exists('/content/gdrive/My Drive/darknet/bin'):os.makedirs('/content/gdrive/My Drive/darknet/bin')

 

!cp ./darknet /content/gdrive/My\ Drive/darknet/bin/darknet

728x90