분류 전체보기

https://zzsza.github.io/development/2020/01/06/jupyter_notebook_voila_dashboard/ Voila를 사용해 Jupyter Notebook Dashboard 만들기 Jupyter notebook에서 voila를 사용해 대시보드 만드는 방법에 대해 작성한 글입니다 R의 Shiny처럼 Python Jupyter Notebook에선 Voila를 사용하면 빠르게 웹에 대시보드를 띄울 수 있습니다 zzsza.github.io
import torchvision # imgs shape = torch.Size([1, 3, 1056, 736]) torchvision.utils.save_image(imgs,'./test.jpg') torchvision 내 utils.save_image 함수 적용 import cv2 cv2.imwrite('./test.jpg', imgs) cv2 내 imwrite 함수 적용 from PIL import Image # 이미지 열기 im = Image.open('python.png') # 이미지 크기 출력 print(im.size) # 이미지 JPG로 저장 im.save('python.jpg') PIL 객체 내 save함수 사용
모델 내 requires_grad를 다 False로 뒀는데, 이상하게 앞단 모델이 엉망이 되었다. 초기모델과 가장 최근까지 학습했던 모델 내 파라미터를 하나씩 비교하던 중, 다음과 같이 backbone 안에 있던 batchnormalization 값은 다 변경되고 있었던 것을 발견했다. backbone.layer1.0.bn1.running_mean backbone.layer1.0.bn1.running_var backbone.layer1.0.bn1.num_batches_tracked 이상 3가지 값들 위주로 변경되고 있었으며, 이 값들은 일반적인 layer 내 파라미터들처럼 optimizer가 loss로 update하는 값이 아니라고 한다. 해당 값들은 forward 과정에서 버퍼에 저장되어 변동되는 값들..
Anaconda는 여러 Python 가상 환경을 구성해서 사용하고 만들 수 있는 것이 큰 장점이다. Linux Windows 간 호환은 잘 안되지만, 같은 OS라면 공유하는 것이 크게 어렵지 않다. 1. Export(가상환경 파일 만들기) 현재 사용하고 있는 가상환경을 activate한 상태 기준으로, 아래 명령어로 yaml파일을 만들어준다. conda env export > [$ENVIRONMENT_NAME].yaml ex) conda env export > test_env.yaml 생성된 yaml 파일은 다음과 같이 가상환경 이름과 채널, 필요한 디펜던시(라이브러리) 목록이 나열되어 있다. 2. Import(가상환경 생성) 이제 앞에서 만든 yaml을 통해 새로운 환경으로 파일을 가져오자. CUDA,..
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn 전체 네트워크 모델 중, 일부 레이어만 requires_grad = True로 셋팅했는데, 특정 구간에서 loss.backward()를 수행할 때, 다음과 같은 에러가 난다. ''' . . . 앞단 : LOSS 계산하는 라인 . . ''' optimizer.zero_grad() loss.backward() #>>여기서 에러 발생 optimizer.step() 실제 해당 구간에서 loss를 print해보면 단순한 cuda Tensor가 나오는데, print(loss) >>> tensor(1.5298, device='cuda:0') 이 사이트에서 loss에도..
for name, param in model.named_parameters(): if [LAYER_NAME] in name: param.requires_grad = True else: param.requires_grad = False ex) for name, param in model.named_parameters(): if 'rec_head' in name: param.requires_grad = True else: param.requires_grad = False https://soyoung97.github.io/pytorch-model-%EC%9D%BC%EB%B6%80-layer%EB%A7%8C-freeze-%ED%95%98%EA%B8%B0/ Pytorch Model 일부 Layer만 Freeze ..
초기 밝은 테마 -> 다크 테마 Settings -> Advanced Settings Editor theme 탭 클릭, 초기에 system Defaults만 적혀 있을 텐데 해당 내용 다 복사해서 오른쪽(User Preferences)로 복붙 20번째 라인 쯤에 "theme": "JupyterLab Light",를 "theme": "JupyterLab Dark", 로 변경 우측 상단으로 저장하면 Dark모드 적용 완료
opencv 내 이미지 크기를 조절해주는 resize함수 사용 시, 다음과 같은 에러 발생 cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'resize' > Overload resolution failed: > - Can't parse 'dsize'. Sequence item with index 0 has a wrong type > - Can't parse 'dsize'. Sequence item with index 0 has a wrong type 1. 이미지의 shape이 맞지 않는 경우 - img.shape을 print하여 None 타입이 아닌지를 확인 2. resize할 사이즈가 일반 숫자 타입이 아닌 경우 - resize ..
RuntimeError: CUDA error: no kernel image is available for execution on the device CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. 3080 GPU 사용 도중, 파이토치 버전과 CUDA버전 상호 호환성 문제로 인하여 생긴 오류로 보인다. +) 일단 anaconda 환경일 경우, cudatoolkit, pytorch를 제대로 설치한게 맞는지 conda list나 pip list로 내가 설치한 버전을 체크해보자. Python 3.6.15 | packaged by conda-forge..
Pytorch 기반의 딥러닝 모델 사용 도중, torch.utils.data.Dataloader로 정의된 dataloader의 next()함수를 호출하여 데이터를 로딩하는 과정에서 상당히 오랜 시간이 걸렸고, ctrl + C로 중단시켜 보니 아래와 같은 오류가 뜬다. ^CTraceback (most recent call last): File "train.py", line 243, in main(args) File "train.py", line 165, in main image_tensors, labels = train_dataset.get_batch() File "dataset.py", line 156, in get_batch image, text = data_loader_iter.next() File ..
논문 PAN++: Towards Efficient and Accurate End-to-End Spotting of Arbitrarily-Shaped Text Scene text detection and recognition have been well explored in the past few years. Despite the progress, efficient and accurate end-to-end spotting of arbitrarily-shaped text remains challenging. In this work, we propose an end-to-end text spotting framew arxiv.org 논문을 깊게 읽고 만든 자료가 아니므로, 참고만 해주세요. 얕은 지식으로 모델..
논문 Efficient and Accurate Arbitrary-Shaped Text Detection with Pixel Aggregation Network Scene text detection, an important step of scene text reading systems, has witnessed rapid development with convolutional neural networks. Nonetheless, two main challenges still exist and hamper its deployment to real-world applications. The first problem arxiv.org 논문을 깊게 읽고 만든 자료가 아니므로, 참고만 해주세요. 얕은 지식으로 모델..
논문 Shape Robust Text Detection with Progressive Scale Expansion Network Scene text detection has witnessed rapid progress especially with the recent development of convolutional neural networks. However, there still exists two challenges which prevent the algorithm into industry applications. On the one hand, most of the state arxiv.org 논문을 깊게 읽고 만든 자료가 아니므로, 참고만 해주세요. 얕은 지식으로 모델의 핵심 위주로만 파악한 자료..
https://m.blog.naver.com/sssang97/221786881113 리눅스에서 구글드라이브 파일 다운받기 먼저 구글드라이브에서 공유가능한 링크를 가져와야 한다. 공개모드로다가... 그리고 저 링크를 보면 id란 ... blog.naver.com 상단 참고 블로그를 보고 진행 드라이브의 공유 링크를 복사해서 아래처럼 파일 ID만 따온다. file/d/[파일 ID]/view?usp=sharing 링크 내 매개변수 id를 저장해놓고 커맨드 라인에 적절히 섞어서 진행 100 MB 이하 wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=파일ID' -O 파일명 대용량 파일 커맨드 wget --load-cookies ..
· 환경구축
https://yjs-program.tistory.com/1 Anaconda설치 Ubuntu 16.04 환경 : Ubuntu16.04 Anaconda Install 1. 파이썬 버전에 맞는 bash파일 다운로드. https://www.anaconda.com/download/#linux 2. 다운받은 bash파일을 command에 설치 bash Anaconda3-5.0.1-Linux-x86_64.sh 3. 설.. yjs-program.tistory.com 가상환경은 이미 설치했다는 가정하에 GPU 딥러닝 환경에 필수적인 CUDA, CUDNN을 설치해보자. 내가 로컬 환경이 존재한다면, 로컬에 다음 포스팅을 참고해서 그대로 설치해도 괜찮다. Ubuntu CUDA 설치 + CUDNN 본 환경은 딥러닝을 위한 ..
Js.Y
'분류 전체보기' 카테고리의 글 목록 (14 Page)