| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 |
- deepstream
- 알고리즘
- 정처기
- C
- 딥러닝
- 딥스트림
- nfs mount
- tao_toolkit
- pyMySQL
- IOU
- 리눅스
- nouveau
- 파이썬
- 네트워크
- dkms
- 주피터 노트북
- 백준
- 타오툴킷
- Python
- mAP@.5
- 도커 컨테이너
- C++
- 스프링
- 비디오미리보기
- Spring
- SQLD
- docker
- Linux
- yolov7
- 도커
- Today
- Total
목록Python (7)
한 번만 더 해보자
상황 하나의 db connection으로 여러개의 스키마를 변경해서 조회하고 싶다 코드 아래 코드를 이용해서 스키마를 변경할 수 있다 conn.select_db('db_B') import pymysql conn = pymysql.connect( user='user', passwd='passwd', host='host', db='db_A', # 초기 데이터베이스 설정 charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor, ) conn.ping(reconnect=True) cursor = conn.cursor(pymysql.cursors.DictCursor) # db_A에서 table_A 조회 cursor.execute("SELECT * FROM table_..
상황 DB에서 select를 해야하는데 계속 컬럼명이 0 1 2 이런 식으로 숫자로 나왔다 후에 컬럼이 추가되면 바로 에러가 날 거 같아서 컬럼명으로 SELECT 결과에 접근해야한다 해결방법 import pymysql conn = pymysql.connect( user= 'user', passwd='passwd', host='host', db='db', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor, # 이 부분 추가 ) conn.ping(reconnect=True) cursor = conn.cursor(pymysql.cursors.DictCursor) # pymysql.cursors.DictCursor을 입력으로 받기
상황 if문을 사용하려고 했는데 다음과 같은 에러 발생 에러 Expected indented blockPylance 원인 들여쓰기를 하지 않았음 아래와 같이 고치면 됨 if a > b: result = a if a > b: result = a
상황 yolo 학습을 돌리려는데 새로 넣은 이미지와 라벨을 매칭하지 못함 에러코드 train: WARNING ⚠️ /usr/home/train/images/warping_img_0001463.jpg: ignoring corrupt image/label: could not convert string to float: '\\ufeff0' 해결 open(file_name, "r", encoding='utf-8-sig') 사용 이미 utf-8-sig를 사용해서 라벨을 만들었다 → uft-8-sig를 적용하는게 아니라 uft-8을 적용해야했다… ㅠㅠ
상황 cv2로 이미지를 읽으려고 하는데 경로의 한글이 깨져서 인식이 안됨 에러코드 [ WARN:0@1.994] global loadsave.cpp:244 cv::findDecoder imread_('C:/Users/Desktop/test/images\\媛뙋_媛濡쒗媛_1462.JPG'): can't open/read file: check file path/integrity Traceback (most recent call last): File "c:\\DEV\\python\\image_warping.py", line 43, in w = img.shape[1] AttributeError: 'NoneType' object has no attribute 'shape' 해결 방법 import numpy as np..