일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 핑거스타일
- OpenCV
- C#
- windows forms
- Docker
- paramiko
- SSH
- VS Code
- Selenium
- ubuntu
- Linux
- YOLO
- Python
- pandas
- C++
- pytorch
- pip
- LIST
- 프로그래머스
- Visual Studio
- JSON
- C
- 오류
- mysql
- error
- Numpy
- label
- 채보
- 컨테이너
- 기타 연주
- Today
- Total
목록전체 글 (322)
기계는 거짓말하지 않는다
Ubuntu 20.04 LTS에서 make 필요 없이 기본 명령어로 OpenCV 4.2.0 버전을 설치 할 수 있다. sudo apt update sudo apt install libopencv-dev python3-opencv 버전 확인 pkg-config --modversion opencv4
한국 시간은 UTC+9이기 때문에 date로 시간 확인을 하면 9시간이 늦다. ls /usr/share/zoneinfo/Asia 위 명령어를 입력하고 Seoul이 존재하는지 찾는다. sudo apt install tzdata 타임존 데이터가 존재하지 않는다면 위 패키지를 설치한다. ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime 위 명령어로 symbolic link를 재설정한다. 이후 date 명령어로 옳게 시간이 바뀌었는지 확인한다.
VS Code SSH 설정 VS Code SSH 설정 우선 마켓플레이스에서 Remote - SSH를 설치한다. Ctrl + Shift + P 입력 시 명령어 창에 원격을 입력하고 원격-SSH: SSH 구성 파일 열기를 클릭한다. 사용자\.ssh\config 선택한다. 이러한 설정 파일이 열린다 machine-does-not-lie.tistory.com 기본적으로 SSH 연결하는 방법과 동일하지만, Docker Container를 생성할 때, 그리고 내부에서 해주어야 할 일이 있다. Docker SSH Settings docker run 시에 22번 포트를 열어주어야 한다. docker run -it -p 임의포트:22 ... # ex) docker run -it -p 10022:22 ... # -p 외부..
Python의 list 복사를 예시로 들 수 있다. 얕은 복사(Shallow Copy)는 list 뿐 아니라 mutable 객체 모두 문제가 된다. Docs: Python copy module copy — Shallow and deep copy operations Source code: Lib/copy.py Assignment statements in Python do not copy objects, they create bindings between a target and an object. For collections that are mutable or contain mutable items, a copy ... docs.python.org List 초기화 # 2차원 list 10행 5열 생성, 초기..
원격으로 서버에 접속해야 할 경우 SSH를 사용한다. 설치 sudo apt update sudo apt install openssh-server 실행 확인 SSH 설치 후 자동으로 실행되지만 확인하는 명령어이다. 명령어 실행 후 Active: 부분을 확인한다. sudo systemctl status ssh 방화벽(Firewall) 확인, SSH 허용 sudo ufw status # 방화벽 활성화 확인 sudo ufw allow ssh # ssh 허용 SSH 활성, 비활성화, 정지, 시작 sudo systemctl enable ssh # 활성화 sudo systemctl disable ssh # 비활성화 sudo systemctl start ssh # 시작 sudo systemctl stop ssh # 정..
계정@hostname:$에 hostname을 변경하는 방법이다. hostname은 Windows의 장치 이름(컴퓨터 이름)과 비슷하다. su # root 계정 로그인 hostname # 현재 hostname 확인 hostnamectl set-hostname # ex) hostnamectl set-hostname ubuntu23
torch의 load를 이용하여 model weight를 불러올 때, module. model 등이 key 값에 더 붙어있거나, key 이름이 다른 경우 변경하여 가지고 올 수 있다. 단, model 구조는 같아야 한다. state_dict = checkpoint[state_key] new_state_dict = {} # load된 model의 key에 model. 이 붙어있을 경우 제거 for k, v in state_dict.items(): if "model." in k: name = k[6:] new_state_dict[name] = v print(new_state_dict.keys()) if len(new_state_dict.keys()) == 0: model.load_state_dict(stat..
Python 객체를 파일로 저장할 때 기본 내장된 pickle 모듈을 사용할 수 있다. Python pickle module docs pickle — Python object serialization Source code: Lib/pickle.py The pickle module implements binary protocols for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python object hierarchy is... docs.python.org 간단한 사용법은 아래와 같다. import pickle class TempClass(object): def __init__(..