본문 바로가기

분류 전체보기47

GPU를 사용한 Pytorch, Tensorflow 설치하기 CUDA, cuDNN을 설치 안 했다면 먼저 아래 링크를 참고하기~ >> GPU 사용을 위한 CUDA, cuDNN 설치하기 - https://ewaterland.tistory.com/19 Pytorch에서 GPU를 쓰는 방법과 Tensorflow에서 GPU를 쓰는 방법이 있다. 둘 다 쓸 거면 둘 다 설치하자 Pytorch 1. CUDA 버전에 맞는 Pytorch 설치하기 - https://pytorch.org/get-started/locally/ PyTorch An open source machine learning framework that accelerates the path from research prototyping to production deployment. pytorch.org Pytor.. 2023. 5. 21.
GPU 사용을 위한 CUDA, cuDNN 설치하기 CUDA, cuDNN을 설치 후 Pytorch나 Tensorflow를 깔고 싶다면 밑의 링크를 참고하기~ >> GPU를 사용한 Tensorflow, Pytorch - https://ewaterland.tistory.com/20 1. 자신의 NVIDIA GPU 버전에 맞는 드라이버 설치하기 - https://www.nvidia.com/Download/index.aspx?lang=en-us 검색하면 자동으로 드라이버를 찾아서 추천해준다. 설치하고 나서 재시작해야 함! 터미널에 nvidia-smi 를 입력하면 드라이버가 잘 설치됐는지 알 수 있다. 2. GPU의 CUDA Compute Capability 버전 확인하기 - https://developer.nvidia.com/cuda-gpus - https://.. 2023. 5. 21.
[Python] 백준 2869번: 달팽이는 올라가고 싶다 코드 import math a, b, v = map(int, input().split()) v = v - a day = 1 x = math.ceil(v / (a-b)) day += x print(day) 풀이 문제를 읽으면 반복문이 가장 먼저 생각나는데, 시간 제한이 0.25초로 굉장히 짧기 때문에 무조건 실패하는 방법이다.. 따라서, 달팽이가 a만큼을 오른 후 v라는 정상에 도착하지 않으면 다시 b만큼 내려오고, 그걸 반복하는 알고리즘을 반복문 사용없이 구현하는 방법을 생각해야 한다. 난 수학에 약해서인지, 떠올리는데 2시간이 소요되었음 ... 우선, 한 줄에 a, b, v를 int형으로 입력받기 위해 map 함수를 써주었다. 그리고, 정상에 도착하기 직전에는 달팽이가 무조건 마지막으로 a만큼 오르기 .. 2023. 5. 19.
[Python] 백준 1157번: 단어 공부 코드 input_str = input() count = [0] * 26 # The number of alphabet alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] # Counting the alphabets for i in range(len(input_str)): if input_str[i].upper() == 'A': count[0] += 1 elif input_str[i].upper() == 'B': count[1] += 1 elif input_str[i].upper() == 'C': count[.. 2023. 5. 17.
[Python] 백준 4344번: 평균은 넘겠지 코드 C = int(input()) # The number of test case for i in range(C): list_temp = list(map(int, input().split())) N = list_temp[0] # The number of student scores = list_temp[1:] # The students's score sum = 0 avg = 0 count = 0 # the number of students who scored higher than avg # Calculating the avg for score in scores: sum += score avg = sum/N # Calculating the percentage of students who scored high.. 2023. 5. 15.
[Python] 백준 1032번: 명령 프롬프트 코드 N = int(input()) # 파일명의 개수 입력 files = [] # 파일명들을 저장할 리스트 pattern = '' # 파일명의 패턴을 저장할 변수 # 파일명들을 여러 줄에 걸쳐 입력받아 리스트에 저장 for i in range(N): files.append(input()) # 첫 번째 파일명을 기준으로 패턴을 생성 for i in range(len(files[0])): char = files[0][i] # 첫 번째 파일명의 i번째 문자 is_same = True # 모든 파일명의 i번째 문자가 같은지 확인 # 나머지 파일명들과 비교하여 i번째 문자가 모두 같은지 확인 for j in range(1, N): if files[j][i] != char: is_same = False break .. 2023. 5. 14.