1. color Script 사용하기

https://colorscripter.com/

 

Color Scripter

Simple & Flexible Syntax HighLighter

colorscripter.com

2. 위 사이트에 코드를 복붙하면 거의 알아서 언어를 감지한다.

3. 오른쪽 하단에 있는 HTML로 복사 클릭해서 ctrl+c복사

4. 글쓰기 사이트에서 html보기로 들어가서 복사한 것 붙여넣기 끝~

 

아래는 예시

1
2
3
4
5
6
def test(**kwargs):
    print(type(kwargs))
    for k, v in kwargs.items():
        print(k, v)
 
test(a=1, b=2, c=3)
cs

 

참고

https://devpouch.tistory.com/121

'컴퓨터 일반' 카테고리의 다른 글

VSC + github 연동  (0) 2022.08.28

 

 

*args는 여러 개의 매개변수를 입력받고 싶을 때 사용(! 몇개가 들어올 지 알 수 없음)

args는 호출할 때 넘겨 받은 매개변수를 tuple로 처리함

 

실행코드
실행결과

 

 

 

**kwargs는 여러 개의 매개변수를 입력받고 싶을 때 사용하는 것은 같으나 딕셔너리 형태로 받아옴

args는 호출할 때 넘겨 받은 매개변수를 tuple로 처리함

실행코드
실행결과

 

=> 매개변수의 개수를 정하기 어려울 때 사용

 

참고(자세한 내용은 아래 블로그)

https://brunch.co.kr/@princox/180

'파이썬' 카테고리의 다른 글

[OJ] 재귀호출제한 풀기  (0) 2023.12.19
[OJ] 빠른 입력 처리  (0) 2023.12.19
[OJ] 정수 입력 받기  (0) 2023.12.18

 

 

import torch

print(torch.__version__)

'PyTorch' 카테고리의 다른 글

[Pytorch] 기본기  (0) 2023.06.11
PyTorch 쿠다 환경 구성 (gpu 사용하기)  (0) 2022.08.28

 

 

1. 문제발생: 기관이나 회사에서 가상환경에 pip로 프로그램 설치하다보면 가끔 SSL보안 문제가 발생

2. 1차 해결은 방법이 2개

  1) pip.ini파일을 만들어서 pip 사용할때마다 신뢰하게 하는 방법

    - C:\Users\user\pip 에 가서 (user폴더에 pip폴더가 없다면 pip폴더 만들기) pip.ini파일 만들고 아래 내용 입력하고 저장

[global]
trusted-host = pypi.org
               files.pythonhosted.org

  2) pip 설치시마다 신뢰하도록 명령어 넣기 (귀찮)

    -설치할 때마다 아래 명령어를 써줘야함

    - <라이브러리>에 원하는 패키지명을 쓰면됨

pip --trusted-host pypi.org --trusted-host files.pythonhosted.org install <라이브러리>

 

3. 머리아픈 문제 발생 pytorch설치하다 에러만남

  -(SSL에러) pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

  - 아래 명령어로 설치 성공

pip install torch===1.7.0 torchvision===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html --trusted-host download.pytorch.org

 

https://better-than-alone.tistory.com/42

https://curryyou.tistory.com/179

 

 

1. CUDA Toolkit down (필자 test는rtx 3060,  11.3.0버전) https://developer.nvidia.com/cuda-toolkit-archive 

 

CUDA Toolkit Archive

Previous releases of the CUDA Toolkit, GPU Computing SDK, documentation and developer drivers can be found using the links below. Please select the release you want from the list below, and be sure to check www.nvidia.com/drivers for more recent production

developer.nvidia.com

2. cuDNN 설치(필자는 11.3버전) https://developer.nvidia.com/cudnn

3. 다운 받은 cuDNN압축풀어서 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3 경로에 넣어주기

4. 파이토치설치: pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113

* 1번 CUDA설치가 되지 않으면 NVIDIA그래픽드라이버를 지우고 다시 설치

*  1번 CUDA를 설치하려는데 다른 설치프로그램이 있다고 하면 서비스에서 windows installer를 정지했다 재시작 후 재부팅하고 실행

5. cmd에서 파이썬 실행하고

>>> import torch

>>> torch.cuda.get_device_name(0)

했을 때 해당 그래픽카드가 검색되면 설치 완료

 

아래 참고 블로그에 자세한 설명 있음

참고: https://leonam.tistory.com/98

'PyTorch' 카테고리의 다른 글

[Pytorch] 기본기  (0) 2023.06.11
설치된 파이토치 버전보기  (0) 2022.08.30

 

 

1. github 회원가입 (이메일 인증 필수) https://github.com/
2. github 다운로드 https://git-scm.com/
3. 깃사이트에서 repository 새로 만들기
4. vscode실행하고 새로운 폴더 열기
5. 콘솔창에 다음 명령어 작성
git init
git config --global user.name "깃네임"
git config --global user.email "이메일주소"
git remote add origin 저장소 주소
6. vscode확장(extension)에서 GitHub Pull Requests and Issues설치

'컴퓨터 일반' 카테고리의 다른 글

[블로그 코드 예쁘게] color Script사용하기  (0) 2022.08.31

 

 

우리나라 데이터 추천 사이트

https://aihub.or.kr/index.do

+ Recent posts