no image
Linux 환경에서 OpenCV의 VideoCapture 사용 시 Webcam이 죽어도 읽히지 않을 때
아래와 같은 식으로 Linux 환경에서 OpenCV(C++)의 VideoCapture 클래스를 사용하여 Webcam을 사용하고자 할 때 웹캠이 read 되지 않는 문제가 있다. VideoCapture cap; // open the default camera using default API cap.open(0); 그럴 땐 먼저 웹캠 USB가 제대로 꽂혀있는지 확인한 뒤, 디바이스가 제대로 연결 되었는지 아래와 같이 확인해보고, ffplay를 사용하여 웹캠이 정상 동작하는지 확인해본다. 그 전에 연결되어있는 카메라의 device 명을 아래와 같이 확인해야한다. $ v4l2-ctl --list-devices ffplay를 사용하여 연결되어있는 Webcam 을 테스트 하는 명령어는 아래와 같다. $ ffplay..
2021.06.25
Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same
아래와 같은 에러시 RuntimeError: Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same x = x.to(device).float() .float() 사용하여 해결한다. 참고자료 : https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=chrhdhkd&logNo=221469768189 pytorch : RuntimeError 발생시 해결방법(Input type and weight type should be the same) 발생한 에러 : RuntimeError: Input type (torch.cuda.Dou..
2021.06.24
no image
Ubuntu 18.04 환경에서 VNC Server 설정했을 때 회색 화면 나타나는 문제
아래와 같이 vnc server 를 연결했을 때 회색 화면으로 뜨는 문제가 발생한다. 실행될 Application 이 아무것도 없어서 뜨는 문제이다. ~/.vnc/xstartup 파일을 수정해주면 된다. 0. process kill 해당 번호를 지워주면 된다. vncserver -kill :2 1. 패키지 설치 sudo apt install gnome-session-flashback 2. ~/.vnc/xstartup 내용 변경 vi ~/.vnc/xstartup #!/bin/sh # Uncomment the following two lines for normal desktop: # unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xsta..
2021.06.11
no image
Pytorch 에서의 TopK error (k not in range for dimension)
pytorch 에서의 input tensor 에서 주어진 k 값에 따라 가장 큰 값 k 개를 찾는 함수이다. image classification 에서 train/validation 시 accuracy 측정할 때 자주 사용된다. 아래와 같은 에러는 TopK 범위를 잘못 지정하였을 때 나는 에러이다. RuntimeError: invalid argument 5: k not in range for dimension at /pytorch/aten/src/THC/generic/THCTensorTopK.cu:26 RuntimeError: invalid argument 5: k not in range for dimension at /pytorch/aten/src/THC/generic/THCTensorTopK.cu:2..
2021.05.10
no image
VNC viewer 에서 Pycharm 실행 시 DISPLAY 문제
VNC Viewer 에서 Pycharm 실행 시 아래와 같이 X11 window server 에 연결하지 못한다는 에러가 난다. Can't connect to X11 window server using 'localhost:2.0' as the value of the DISPLAY variable. 이와 관련된 해결법으로 $DISPLAY 변수를 지정해주는 방법들이 나왔는데, 아래와 같이 먼저 xhost + 명령어를 실행해주면 된다. 이 때 root 권한으로 아래와 같이 실행해준다. 이는 Xwindow의 모든 창들은 Owner(root)의 허락없이 열수 있다는 의미이다. $ xhost + 그 다음 local 환경에서 pycharm.sh 를 실행하면 실행이 정상적으로 된다. 참고자료 1 : xinet.kr/?..
2021.05.10
docker 에서 authentication required 문제
docker docker pull 사용 시 아래와 같이 에러 나는 경우가 있다. Error response from daemon: Head https://~~~~: unauthorized: authentication required 아래와 같이 해결하면 된다. 1. 아래 사이트에서 엔비디아 계정과 같은 계정으로 로그인 (API key 를 생성하여 사용 필요) ngc.nvidia.com/ NVIDIA NGC ngc.nvidia.com 2. API key 는 안전한 곳에 저장 3. 도커 로그인 $ docker login nvcr.io Username: $oauthtoken Password: [API KEY] 4. 원하는 이미지 다운받기 $ docker pull nvcr.io/nvidia/pytorch:19...
2021.03.08
/usr/bin/ld: cannot find -luuid
/usr/bin/ld: cannot find -luuid 에러 발생 시 sudo apt-get install uuid-dev 참고자료 : www.programmersought.com/article/5373747707/ The solution to the -llzo2 and -luuid problems occurred during the android source code compilation process - Programmer Sought forward from:http://blog.csdn.net/hhwahzl/article/details/46520137 1. The following error occurred during the compilation process: lzo/lzo1x.h: No su..
2021.02.15
pytube 를 이용하여 youtube 영상 크롤링 시 발생하는 문제
pip install pytube 명령어를 통해 pytube 패키지를 깔고 유튜브 영상 크롤링을 하려는데 어떤 영상은 정상으로 다운로드되고 또 어떤 영상은 아래와 같은 에러가 발생해서 AttributeError: 'NoneType' object has no attribute 'download' pip install pytube3 명령어를 통해 pytube 패키지를 깔았더니 아래와 같은 에러가 발생하였다. pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match for config_patterns ../pytube/extract.py 에서 config_patterns 을 바꿔보기도 했지만 소용 없어서 아래와 같이 github ..
2020.12.28
Ubuntu 환경에서 exfat 포맷의 외장하드 마운트 안될 때
unknown filesystem type 'exfat' 위와 같이 exfat 포맷의 외장하드가 우분투 환경에서 마운트가 안될 때 아래와 같이 패키지를 설치해주면 된다. $ sudo apt-get install exfat-fuse exfat-utils
2020.12.14
no image
cublasStatus == CUBLAS_STATUS_SUCCESS
에러 환경 Windows 10 64bits CUDA 10.2 cudnn 8.0 TensorRT 7.2.1.6 Visual Studio 2019 위와 같은 환경에서 TensorRT 를 사용했을 때 cublas 와 관련된 에러가 다음과 같이 발생했었다. Assertion failed: cublasStatus == CUBLAS_STATUS_SUCCESS C:\source\rtSafe\cublas\cublasLtWrapper.cpp:279 Aborting... Builder timing cache: created 395 entries, 722 hit(s) C:\source\rtSafe\cublas\cublasLtWrapper.cpp (279) - Assertion Error in nvinfer1::CublasL..
2020.12.01
AttributeError: module 'tensorflow' has no attribute 'io'
Problem: AttributeError: module 'tensorflow' has no attribute 'io' Solution : pip install tensorflow Reference : github.com/thu-ml/tianshou/issues/39 AttributeError: module 'tensorflow' has no attribute 'io' · Issue #39 · thu-ml/tianshou I have marked all applicable categories: exception-raising bug RL algorithm bug documentation request (i.e. "X is missing from the documentation.") new feature ..
2020.11.05
[OpenCV] imwrite 시 확장자 지정 안할 시 나는 에러
cv::imwrite("result.jpg", frame); imwrite 시 확장자 지정 안할 시 나는 에러는 아래와 같다. OpenCV Error: Unspecified error (could not find a writer for the specified extension) in imwrite_, file ....../modules/imgcodecs/src/loadsave.cpp, line 677 terminate called after throwing an instance of 'cv::Exception' what(): ....../modules/imgcodecs/src/loadsave.cpp:677: error: (-2) could not find a writer for the specified..
2020.10.23