본문 바로가기

전체 글70

AttributeError: module ‘base64’ has no attribute ‘encodestring‘ Base64란 data를 ASCII 문자로 이루어진 문자열로 바꾸는 인코딩(encoding)이다. 아래의 링크에 base64에 대한 설명이 잘 되어 있다. https://effectivesquid.tistory.com/entry/Base64-인코딩이란 Base64 인코딩이란? 인코딩이란? Base64 인코딩에 대해 알아보기전에 먼저 인코딩이란게 무엇인지 간략하게 알아보자. 인코딩(encoding)은 정보의 형태나 형식을 표준화, 보안, 처리 속도 향상, 저장 공간 절약 등을 위 effectivesquid.tistory.com base64 has no attribute encodestring 에러 발생 import base64를 해주고 base64.encodestring()을 사용하려고 했더니 base64.. 2023. 2. 9.
[Docker] /var/run/docker.sock permission denied /var/run/docker.sock에 대해 권한 거부 문제가 발생하였을 경우 docker를 설치하고 container를 만들기 위해 명령어를 실행하였더니 다음과 같이 권한 문제에 대한 오류가 발생했다. docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied. 해당 부분에 대해 다음과 같은 명령어를 하면 해결될 줄 알았는데 해결 방법이 아.. 2023. 2. 2.
[python] pip install TypeError: expected str, bytes or os.PathLike object, not int TypeError: expected str, bytes or os.PathLike object, not int Problem local환경에서 python3.9를 설치하고, python3-pip을 설치했더니 pip install을 할 때마다 밑에와 같은 에러가 발생했다. TypeError: expected str, bytes or os.PathLike object, not int Solution 이런 저런 방법이 있겠지만 내 경우는 설치했던 python3-pip을 제거하고 get-pip.py를 받아서 설치했더니 해결됐다. wget https://bootstrap.pypa.io/get-pip.py python get-pip.py 2023. 1. 4.
[Pytorch] CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling `cublasSgemm cublasSgemm에 대한 오류가 발생하였을 경우 Pytorch 프레임워크로 코드를 학습하던 중 갑자기 다음과 같은 오류가 발생했다. CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling `cublasSgemm cublasSgemm에 대한 오류 해결 방법 google에 검색을 해보면 내 문제처럼 loss를 backward()할 때 발생하는 문제에 대한 해결 글은 없었고, 기존에 돌아가던 코드였는데 갑자기 실행이 안돼서 원인은 정확히 모르지만 pytorch version을 내렸더니 해결되었다. # 기존 version cudatoolkit==11.3.1 pytorch==1.13.0 torchvision==0.14.0 # 변경한 version cudatoolkit==.. 2022. 12. 14.
[Python] DCM파일을 jpg나 png의 image 파일로 변환 DCM 확장자를 png image 파일로 변환 DICOM(Digiral Imaging and Communications in Medicine)은 의료 분야에서의 표준으로 파일들을 보면 .dcm으로 되어 있다. 방법 1 dcm 파일은 밑의 명령어로 적어둔 pydicom 패키지를 설치해서 파일을 읽고 변환해서 바로 사용할 수도 있다. (해당 방법은 해당 글에는 적지 않았다.) pip install pydicom 방법 2 그리고, 밑의 명령어로 적어둔 mritopng 패키지를 설치해서 png나 jpg와 같은 이미지로 변환해서 바로 저장할 수 있다. pip install mritopng mritopng를 사용해서 이미지를 저장하는 방법은 단일 이미지 파일에 대해 저장 폴더 내의 이미지들에 대해 저장 이 있다. .. 2022. 12. 5.
[VSCode] 코드 실행 시 conda 가상 환경 연결 안될 때 conda 가상 환경에서 code build VSCode에서 python: Select interpreter로 conda 가상 환경을 설정한 후 ctrl + F5로 코드를 실행하면 보통은 자동으로 terminal에서 설정한 가상 환경으로 activate 되면서 해당 가상 환경으로 코드가 실행된다. python: Select interpreter를 하는 방법은 밑의 링크에 설명되어 있다. https://shuka.tistory.com/22 [VSCode] VSCode에 Anaconda env 연결 vscode에서 쉽게 anaconda 가상환경을 연결해서 사용할 수 있다. anaconda env 연결 Ctrl + Shift + p를 눌러서 python:Select Interpreter를 선택한다. 그러면 다.. 2022. 11. 22.
[Triton Inference Server] CUDA driver version is insufficient or CUDA runtime version CUDA driver version is insufficient or CUDA runtime version Problem tensorrt 모델로 변환하고 tritonserver를 load 하는데 다음과 같은 오류가 발생했다. solution 내 경우에는 docker 설정을 건드리니까 해결이 됐다. /etc/docker/의 폴더에 가면 deamon.json이라는 폴더가 있는데 열어보면 다음과 같이 적혀 있다. kubernetes설치하고 그러느라 적혀 있는건 다를 수도 있다. { "exec-opts": ["native.cgroupdriver=systemd"], "log-driver": "json-file", "log-opts": { "max-size": "100m" }, "storage-driver": "o.. 2022. 11. 4.
[Kubernetes]외부 접근이 힘든 서버에서 kubernetes 설치 외부 접근이 힘든 서버에서 kubernetes 설치 밑의 link에서 패키지 매니저를 사용하지 않는 경우 선택 후 설치하면 되는데 기본적으로 몇 가지 필요한 파일들을 미리 받아서 옮겨야 된다. docker images cni-plugin crictl kubeadm, kubelet, kubectl kubelet.service 10-kubeadm.conf weave-daemonset-k8s-.yaml nvidia-device-plugin.yaml https://kubernetes.io/ko/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ kubeadm 설치하기 이 페이지에서는 kubeadm 툴박스 설치 방법을 보여준다. 이 설치 프로세스를 .. 2022. 11. 1.
[ONNX] Convert TorchScript model to Onnx model pytorch 모델을 onnx모델로 변환하는 방법 pytorch 모델을 onnx모델로 변환하는 방법은 아래의 링크를 보면 설명이 되어 있다. https://shuka.tistory.com/26 [Pytorch] pytorch모델을 onnx모델로 변환 방법 pytorch 모델을 tensorrt로 변환하기 위해서는 pytorch 모델을 onnx로 변환을 해야 하는 단계를 거쳐야 하는데, 변환을 할 때 batch를 원하는 size로 고정을 할 수도 있고 dynamic batch로 설정해 줄 수도 있다. shuka.tistory.com TorchScript모델을 onnx모델로 변환 중 발생한 Errror TorchScript모델을 onnx모델로 변환하기 위해서는 위의 링크에서 얘기한 내용과 같이 export를 .. 2022. 10. 25.
[ONNX] Onnx-modifier Onnx-modifier란 모델의 구조를 visualize하기 위해 주로 사용하는 사이트가 netron.app이다. onnx-modifier는 netron을 기반으로 개발됐고, onnx model을 visualization뿐만 아니라 editting까지 가능하다. Onnx-modifier가 지원하는 기능 현재 지원하는 기능들은 다음과 같다. Delete/recover nodes Delete a single node. Delete a node and all the nodes rooted on it. Recover a deleted node. Rename the node inputs/outputs Rename the model inputs/outputs Add new model outputs Edit the.. 2022. 10. 21.
[Kubernetes] node had taint, that th pod didn't tolerate node had taint, that th pod didn't tolerate problem kubernetes에서 밑에의 명령어로 pod를 올리고 log를 확인했더니 status가 ready가 아닌 pending으로 되어 있다. kubectl apply -f kubectl get all -o wide describe로 확인해 봤더니 'node.kubernetes.io/not-ready'라는 에러가 발생했다. tolerate problem 해결 방법 해당 오류는 master node에 대해 taint 해주면 해결이 됐다. 우선, node에 대한 이름을 확인한다. kubectl get nodes Name status roles ... master NotReady control-plane,master ..... 2022. 10. 7.
[Kubernetes] Kubernetes unable to connect to the server kubernetes에서 server에 연결할 수 없는 문제 발생 kubernetes를 설치하면서 'sudo kubeadm init'에서 successfully까지 됐는데 kubectl을 사용하니까 아래와 같은 문제가 발생했다. Problem Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes") Solution 아래의 방법이 무조건 해결이 될지는 모르겠지만 내 경우에는 해결이 됐다. mkdir -p $H.. 2022. 10. 5.
728x90