728x90
전체 글
544

[주말 실험 일지 - 토] P Stage - 모델 최적화(경량화)

num_class를 6으로 수정 -> 기존에 1000으로 해놓고 있었음 -> Average CUDA time 0.022, inference 54초 img size 224 에서 112변경 후 inference 51초 -> img size 112로 변경 후 학습 -> onecyclelr에서 maxlr과 초기 lr을 같게 설정해주고 있었음 -> maxlr = lr * 10으로 설정해주고 학습 -> warmup 방식보다 maxlr에서 lr을 감소하는 방식이 좀 더 좋은 성능을 보여줌 이미지 사이즈를 112로 변경했을때 test f1 score 0.71~0.72에서 정체됨 이미지 사이즈 224의 0.75인 168로 변경하여 학습 -> 50epoch 학습했을때 좀 더 수렴할 것 같은 여지가 보임 -> 100epoc..

Boostcamp AI Tech 2021.12.06

[실험 일지 Day-79] P Stage - 모델 최적화(경량화)

optuna를 사용하여 AutoML으로 새로운 모델을 탐색 -> 시간이 상당히 오래걸림 mobilenet v3를 automl로 성능향상을 가져왔다고 하는 MoGA 모델을 깃헙에서 불러옴 -> 뭔가 잘 안되고 있음 -> 1epoch에 80 ~ 82초 (train+val) 가 걸림 -> rand augmentation을 적용 -> 성능이 약 2%정도 향상 inference 시간 : Average CUDA time: 0.029426145510253906, CPU time: 0.02918666520000016 제출 결과 f1 score는 0.76 -> 0.771, time은 84.843 -> 83.781으로 성능이 약간 좋아짐 파라미터가 훨씬 작은 MnasNet을 학습 -> inferenece 시간을 확인했을때..

Boostcamp AI Tech 2021.12.06

[실험 일지 Day-78] P Stage - 모델 최적화(경량화)

https://github.com/jacobgil/pytorch-tensor-decompositions/blob/master 에서 tensor decomposition 코드를 확인할 수 있었음 network compiling 관련 라이브러리로 [Glow](https://github.com/pytorch/glow)가 있고 설치법 관련 [블로그](https://goodtogreate.tistory.com/entry/Glow-%EC%84%A4%EC%B9%98%EB%B2%95)가 있음 pre-trained 모델을 load하여 학습 -> f1 score가 약 0.73 정도 나옴 -> 20epoch 쯤부터 overfitting이 일어나는 것 같음 Tensor Decomposition 적용 -> 1초 정도 학습 시간..

Boostcamp AI Tech 2021.12.06

[실험 일지 Day-76] P Stage - 모델 최적화(경량화)

베이스라인에서 FP16을 사용하여 Data를 불러왔음 -> FP16은 Floating Point 16을 말하고 뒤에 숫자 16은 정밀도를 말하는 것같다. 만약 FP32라고 한다면 32bit를 이용하여 실수를 저장하고 FP64라고 하면 64bit를 이용하여 실수를 저장한다. 그러니까 FP16을 사용하면 더 적은 bit를 사용하게되서 저장 공간도 절약되고 연산 속도도 빨라지는 것 같다. 하지만 정밀도에서는 당연히 떨어질 것이다. amp.gradscaler -> 특정 연산에 대한 forward pass에 float16 입력이 있는 경우 해당 연산에 대한 backward pass는 float16 gradient를 생성한다. 크기가 작은 gradient 값은 float16에서 표현할 수 없다. 이러한 값은 0(u..

Boostcamp AI Tech 2021.12.06

[Boostcamp Day-75] 최적화 소개 및 강의 개요

경량화의 목적 모델의 연구와는 별개로 산업에 적용되기 위해서 거쳐야하는 과정 요구조건(하드웨어 종류, latency 제한, 요구 throughput, 성능)들 간의 trade-off를 고려하여 모델 경향화/최적화를 수행 경량화, 최적화의 대표적인 종류 Efficient Architecture Design(+AutoML;Neural Architecture Search(NAS)) Network Pruning : 가지치기라고도 한다. 학습된 네트워크를 가지고 있다라고 했을 때 그 네트워크의 중요도가 낮은 파라미터들을 제거해서 사이즈를 줄여보자라는 접근법이다. Knowledge Distillation : 학습된 큰 규모의 teacher network가 있을 때 작은 student network의 teacher ..

Boostcamp AI Tech 2021.12.06

[Ubuntu] SSH 파일을 사용하여 Local -> Remote(Server) 파일 전송

1. 일단 key file을 ~/.ssh로 복사해줍니다. (로컬 파일 위치는 '/mnt/c') sudo cp ~/.ssh/ 2. 복사해온 key file을 사용하게되면 private key라며 오류가 뜨므로 다음과 같이 chmod를 사용하여 후처리를 해줍시다. chmod 0600 ~/.ssh/key 3. ~/.ssh 위치에 config를 다음과 같이 만들어줍니다. echo -e "Host MyServer HostName Port User IdentityFile ~/.ssh/key" >> ~/.ssh/config 4. 이제 다음과 같이 rsync를 사용하여 파일을 전송해줍니다. rsync -a --progress MyServer: 이때 로컬하고 서버에 모두 rsync가 설치되어있어야합니다.

Temp 2021.12.01

[Torch.tensor] ValueError: At least one stride in the given numpy array is negative, and tensors with negative strides are not currently supported.

다음 코드에서 numpy.ndarray를 torch.tensor로 변환하는 중 에러가 발생하였다. last_layer.weight.data = torch.tensor(last).unsqueeze(-1).unsqueeze(-1) 다음과 같이 torch.from_numpy()와 copy()를 사용하여 해결하였다. last_layer.weight.data = torch.from_numpy(last.copy()).unsqueeze(-1).unsqueeze(-1) [ref] https://stackoverflow.com/questions/57517740/pytorch-custom-dataset-valueerror-some-of-the-strides-of-a-given-numpy-array-a

Temp 2021.11.30

[Filezilla] SSH 파일을 사용하여 Local -> Remote(Server) 파일 전송

설치 다음 링크에 들어가서 FIleZilla를 설치합니다. 이때 window10 사용자는 실시간 감시를 꺼주셔야합니다. 안그러면 자동으로 삭제를 합니다. https://filezilla-project.org/ FileZilla - The free FTP solution Overview Welcome to the homepage of FileZilla®, the free FTP solution. The FileZilla Client not only supports FTP, but also FTP over TLS (FTPS) and SFTP. It is open source software distributed free of charge under the terms of the GNU General Publ..

Temp 2021.11.30
728x90