[Linux] dmidecode 사용하여 메모리 정보 확인하기
dmidecode 리눅스에서 dmidecode 를 사용하여 메모리 정보를 확인 할 수 있다. Usage: dmidecode [OPTIONS] Options are: -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem) -h, --help Display this help text and exit -q, --quiet Less verbose output -s, --string KEYWORD Only display the value of the given DMI string -t, --type TYPE Only display the entries of given type -u, --dump Do not decode the entries --d..
2021.08.06
identifier "AT_CHECK" is undefined
FCOS Install 또는 MaskRCNN install 과정 중 deform_conv_cuda.cu 파일에서 AT_CHECK 를 못찾는다는 에러가 자꾸 났었다. fcos_core/csrc/cuda/deform_conv_cuda.cu(72): error: identifier "AT_CHECK" is undefined 이 때 deform_conv_cuda.cu 파일에서 아래와 같이 정의해주면 된다. #ifndef AT_CHECK #define AT_CHECK TORCH_CHECK #endif 참고자료 : https://github.com/mrlooi/rotated_maskrcnn/issues/31#issuecomment-631416601 Hi, this project won't compile becaus..
2021.08.02
[Object Detection ] What does mlvl mean?
mmdetection 모듈 쓰다가 mlvl 의 의미가 궁금해서 알아보았다. class mmdet.core.anchor.MlvlPointGenerator(strides, offset=0.5) multi-level (Mlvl) 이였다.... 주로 2D Points 기반 검출기의 Multi-level(Mlvl) Feature Map 을 위한 point 를 생성할 때 사용하며, Object Detection 분야에서 Anchor Free 스타일의 헤더(Header) 에서 주로 사용된다. def get_points(self, featmap_sizes, dtype, device, flatten=False): """Get points according to feature map sizes. Args: featmap_..
2021.07.28
no image
[ONNX] ONNX Simplifier 사용하여 모델 간소화 하기
ONNX Simplifier 는 복잡한 ONNX node 들 즉 ONNX 모델을 단순하게 만들어주는 툴이다. 전체 계산 그래프(the whole computation graph)를 추론한 다음 중복 연산자(the redundant operators)를 상수 출력(their constant outputs)으로 대체한다. 아래 그림의 왼쪽 그림은 어떤 모델의 ONNX 원본 모델이고, 오른쪽 그림은 onnx simplifier를 거친 ONNX 모델이다. (잘 보이진 않지만... 자세히 들여다보면 간소화 된 모습을 볼 수 있었다... 모델 크기도 줄어든다.) 아래 그림을 보면 더 명확히 와닿는다. 이런 느낌이다. 불필요한 Gather 및 Unsqueeze 연산자 등의 조합을 Reshape 으로 대체한다. 원래 ..
2021.07.26
no image
mmdetection 으로부터 학습한 모델을 ONNX 및 TensorRT 로 변환 시 나타나는 문제
mmdetection 으로부터 학습한 딥러닝 모델을 ONNX 모델로 변환하고, TensorRT 로 변환하는 과정에서 아래와 같이 importTopK 레이어(노드)를 TensorRT 에서 인식을 못하여 변환이 안되는 문제가 발생하였다. In node -1 (importTopK): UNSUPPORTED_NODE: Assertion failed: inputs.at(1).is_weights() ERROR: builtin_op_importers.cpp:3455 In function importTopK: [8] Assertion failed: inputs.at(1).is_weights() mmdetection 에서는 아래와 같이 여러 TensorRT Plugin 을 제공하고 있다. 아마 이 플러그인들을 처리하는 과..
2021.07.26
no image
[Book Review] 업무에 바로 쓰는 SQL 튜닝
이 책은 이제 막 DB를 배우고자 하는 사람들에게 적격인 책이다. 본 책의 구성은 5개의 파트로 나눠져있으며, MySQL과 MariaDB 개요부터 시작해서 초보자가 데이터베이스의 기본을 잘 이해할 수 있게끔 적절한 설명과, 적절한 예시들로 설명되어있다. 특히 효율적인 MySQL 계열에서 쿼리를 잘 짜고싶은 개발자들에게 추천한다. 책 두께도 그렇게 두껍지 않아 SQL 튜닝 입문자들이 갖고다니면서 개념설명과 간단한 예제들을 술술 읽어볼 수 있을 것 같다. 특히나 4장에서 악성 SQL 튜닝으로 초보자 탈출하기 챕터에서 쿼리를 재작성하여 튜닝을 수행하는 실습을 진행하는 부분이 알찼던 것 같다. 한빛미디어 활동을 위해서 책을 제공받아 작성된 서평입니다.
2021.07.25
no image
fatal error: libpq-fe.h: No such file or directory
아래와 같은 에러 발생 시 libpq-dev 패키지를 설치해주면 해결된다. fatal error: libpq-fe.h: No such file or directory $ sudo apt-get install libpq-dev 위와 같이 설치를 진행했는데 아래와 같이 dependency 문제가 나온다면, 해당 패키지를 dependency 에 맞게 재설치 해준다. The following packages have unmet dependencies: libpq-dev : Depends: libpq5 (= 10.3-1) but 13.3-1.pgdg18.04+1 is to be installed Reading package lists... Done Building dependency tree Reading sta..
2021.07.15
Image Classification 시 분류 결과 한쪽에 치우쳐져서 나오는 현상
weight 파일을 load 하지 않고 테스트 시 model 구조만 불러와서 inferece 하기 때문에 분류 결과는 class A : 0.54, class B : 0.46 이런식의 값이 산출되게 된다. 반드시 weight 파일을 load 할 때 path 를 잘 지정해주어야 하며, (예외 처리도 반드시 해야함) load_state_dict(checkpoint['state_dict'] 을 꼭 해주어야한다.
2021.07.01
no image
[Linux] Code Blocks 설치하기
1. Code Blocks 리눅스 버전 설치하기 (~/Downloads) https://www.codeblocks.org/downloads/binaries/#imagesoslinux48pnglogo-linux-32-and-64-bit Binary releases www.codeblocks.org 2. 압축 풀기 cd ~/Downloads tar -xf codeblocks_20.03_amd64_oldstable.tar.xz 3. 설치 sudo dpkg -i *20.03*.deb sudo apt-get install -f 4. 실행 codeblocks 참고자료 : https://askubuntu.com/questions/1030720/how-to-install-latest-codeblocks-from-tar..
2021.07.01
no image
[ONNX] Pytorch 모델을 ONNX 모델로 변환 할 때 dynamic_axes 지정하는 방법
LSTM 같은 모델을 ONNX 모델로 변환할 경우, 이 모델은 입력 값을 동적으로 설정할 수 도 있기 때문에 ONNX 모델로 export 시 dynamic_axes 를 설정하여 동적인 입력 값을 갖는 ONNX 모델로 변환할 수 있다. torch 공식 문서에 나와있는 내용은 다음과 같다. dynamic_axes (dict or dict, default empty dict) – a dictionary to specify dynamic axes of input/output, such that: - KEY: input and/or output names - VALUE: index of dynamic axes for given key and potentially the name to be used for expo..
2021.06.29
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