본문 바로가기
728x90
반응형

Programming52

[Pandas] UnicodeDecodeError: 'utf-8' codec can't decode byte 해결방법 증상 Pandas api로 csv파일을 읽을 때, 다음과 같은 UnicodeDecodeError가 날 수 있다. df = pd.read_csv('test.csv') 이 에러는 읽어드릴 파일의 포맷이 UTF-8이 아니기 때문에 발생한다. 해결 위의 pandas.read_csv 함수를 보면 encoding/encoding_errros이란 변수가 있고, 이것들의 디폴트는 각각 None과 strict이다. 이 변수값을 따로 지정해주면 에러를 해결할 수 있다. 두 가지 방법이 있다. 1. 인코딩 에러를 무시하는 방법 (encoding_errors='ignore') 첫번 째 방법은 이 에러를 무시하는 것이다. 다음과 같이 encoding_errors를 ignore로 하면 해결할 수 있다. df = pd.read_c.. 2022. 4. 13.
ValueError: matrix contains invalid numeric entries 에러 억제 방법 (Yolov5 + deepSORT) 증상 Yolov5 + deepSORT object tracking 알고리즘 실행 시 다음과 같은 에러를 만났다. 어떤 matrix에 숫자로 타당하지 않은 원소가 있다는 에러이다. return _lsap_module.calculate_assignment(cost_matrix) ValueError: matrix contains invalid numeric entries 이 에러는 linear_assignment.py 파일안에 있는 scipy.optimize.linear_sum_assignment()에 의해 계산된 cost_matrix에 nan (Not a Number)이 포함되어 있어 발생하는 에러이다. 아래와 같이 프로그램을 다시 돌려 cost_matrix가 어떤 값을 가지는지 확인해보자. 역시 NaN이 .. 2021. 10. 26.
FFMPEG로 다양한 input-output 소스 스트리밍하기 (option 설명 포함) FFMPEG은 영상을 인코딩/디코딩하는데 사용되는 프로그램이다. 영상처리의 특성상 설정할 수 있는 변수들이 수도 없이 많다. 그중에 몇가지 live streaming 관련해서 유용하게 쓸 수 있는 명령어를 정리해 보았다. 관련 옵션도 함께 정리하였으며, 이렇게 해 두면 다음에 다시 찾기도 편할 것으로 생각된다. Case 1: MP4 ---> MP4 ffmpeg -re -i myvideo.mp4 -codec copy -f mp4 output.mp4 설명: myvideo.mp4를 (-re)로 고유의 프레임 속도로 읽어서 (-f) mp4 포맷으로 출력한다. Case 2: rtsp live stream ---> MP4 ffmpeg -rtsp_transport tcp -i rtsp source -r 10 -t 6.. 2021. 10. 23.
Git: "please tell me who you are" 에러 해결 문제 - Git commit 시 다음과 같은 에러 발생 이전까지 잘 작동하던 git 명령어에서 "누구냐 넌!" 이라는 메세지를 출력하는 에러를 만남. Author identity unknown *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. 다음의 실행으로 문제 해결 git init git config user.name "someone" git confi.. 2021. 10. 19.
728x90
반응형