728x90

DeepLearning 48

[Pytorch] torch.no_grad() versus requires_grad=False

prompt learning 코드 보는데 갑자기 이해가 안가는 점이 생김. 궁금증은 아래 이슈에서부터 시작됨. https://github.com/KaiyangZhou/CoOp/issues/7 question about gradients on text encoder · Issue #7 · KaiyangZhou/CoOp Hi, may I ask if the gradients of the original CLIP text encoder are frozen or not? The paper mentioned that the gradients of text encoder is frozen, but I couldn't find that part in the code... Th... github.com 여기 보면, C..

[Paper Review] BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation (ICML'22)

오늘 리뷰할 논문은 22년도 ICML에서 발표된 BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation 입니다. 기존의 VLP 연구의 한계를 모델, 데이터 두 가지 관점에서 설명하며 이를 보완한 unified VLP framework를 제안합니다. 실험 결과가 매우 강력했지만, dataset bootstrapping으로 얻은 효과 이외에도 구조 자체의 이점 또한 있었던 것 같습니다. Training cost (time)에 대한 이야기가 있었다면 bootstrapping에 대한 정당성이 조금 더 높아지지 않았을까 합니다. 후속 연구인 BLIP2에서는 end-to-end pre..

[Paper Review] Masked Autoencoders Are Scalable Vision Learners (CVPR'22)

오늘 리뷰할 논문은 Masked Autoencoders Are Scalable Vision Learners (a.k.a. MAE)입니다. 22년도 CVPR에서 oral presentation으로 선정된 논문이며, Masked Modeling을 아주 간단한 방식을 통해서 Vision 분야의 self-supervised pre-training에 성공적으로 적용한 논문입니다. 이 방법론은 Simple, effective, scalable하다고 정리할 수 있겠습니다! 하기할 내용에 오류 혹은 질문이 있을 경우 언제든 댓글 부탁드립니다! Abstract We mask random patches of the input image and reconstruct the missing pixels based on two ..

[Paper Review] DINO: Emerging Properties in Self-Supervised Vision Transformers (ICCV'21)

Emerging Properties in Self-Supervised Vision Transformers 이번에 리뷰할 논문은 2021년 ICCV에서 발표된 Emerging Properties in Self-Supervised Vision Transformers (Venue: Facebook AI Research)입니다. DINO라는 self-distillation 구조의 자기지도학습 방법론을 제안하며, 동시에 self-supervised learning과 ViT가 결합되며 발생하는 특성들에 대한 분석과 흥미로운 실험 결과를 논문에서 밝히고 있습니다. 특히 self-supervised ViT가 segmentation mask에 대한 정보를 갖고 있다는 특성이 굉장히 재미있었고, 기존의 supervised..

[Paper Review] UNIFIED-IO: A Unified Model For Vision, Language, And Multi-Modal Tasks (ICLR'23)

오늘 리뷰할 논문은 ICLR'23에 notable top 25%로 선정된 Unified-IO: A Unified Model For Vision, Language, And Multi-Modal Tasks 라는 논문입니다. 논문에서는 하나의 모델로 기존의 연구에서 다루던 task보다 많은 range의 task를 다루는 unified architecture를 제안합니다. 아이디어는 간단합니다. Encoder-decoder 구조를 통해 architecture에 있어서 unification을 이루면서도 다양한 input, output을 generate할 수 있게 모두 discrete tokenization을 통해서 architecture에 feed하겠다는 것입니다. 대략 30억개의 파라미터를 갖는 XL 모델을 p..

[Paper Review] MetaFormer is Actually What You Need for Vision (CVPR'22)

오늘 리뷰할 논문은 CVPR 2022 oral로 선정된 페이퍼인 'MetaFormer is Actually What You Need for Vision'이라는 논문입니다. Vision task를 위해 실질적으로 필요한 것은 well-designed token mixer가 아닌 metaformer라는 transformer-like models가 공유하고 있는 추상화된 구조라는 주장을 하고 있습니다. 이를 위해 poolformer라는 아주 간단한 pooling operation을 통해 token mixing을 함으로써 실질적인 성능 기여는 well designed token mixer가 아닌 metaformer 구조 자체임을 보여주고 있습니다. 기존의 연구 방향이 어떤 token mixer를 사용해야 하고,..

[Paper Review] Patch-level Representation Learning for Self-supervised Vision Transformers (CVPR'22)

오늘은 CVPR 2022에서 oral presentation으로 선정된 논문인 Patch-level Representation Learning for Self-supervised Vision Transformers (a.k.a. SelfPatch) 를 리뷰해보도록 하겠습니다. 기존의 SSL ViT 아키텍처가 모두 global representation만을 loss에서 활용된다는 점을 이야기하면서 이러한 부분은 attention의 collapse로 이어지며 representation quality를 떨어뜨린다고 문제를 제기하고 있습니다. 해당 논문은 ViT 아키텍처에서 손쉽게 patch representation을 얻을 수 있음에도 불구하고 이러한 부분은 전혀 활용되지 않고 있다는 점에서 출발하여, ViT..

[Pytorch] Distributed Data Parallel (multi-gpu 학습)

오늘은 여러 gpu 디바이스에서 분산 학습을 수행하는 방법을 정리해보겠습니다. 하기한 내용에 오류가 있을 경우 댓글 부탁드립니다. How to parallel Model parallel 모델을 쪼개서 여러 gpu (병렬적)로 뿌려주는 경우입니다. model이 너무 커서 하나의 gpu 메모리가 충분하지 못할 때의 문제인 것 같습니다. 1번 디바이스에서는 전체 forward process의 part1을 맡고, 2번 디바이스에서는 part2를 맡는 방식으로 분산 학습이 진행됩니다. 간단히 코드를 작성해보면 아래와 같습니다. class ModelParallel(nn.Module): def __init__(self, *args, **kwargs): super(ModelParallel, self).__init__(..

[Pytorch] 여러 gpu 사용할 때 torch.save & torch.load (feat. map_location)

굳이 multi-gpu에서 분산 학습을 한 게 아니더라도, 여러 gpu를 사용할 수 있는 환경이라면 한 번쯤 겪어볼 만한 error에 대한 해결책 정리. 0번 gpu에서 모델을 학습시키고 torch.save를 통해 저장한 상황이라고 할 때, 1번 gpu에서 torch.load를 통해 해당 weight을 가져와서 학습을 재개하고자 하는 경우 혹은 재학습시키고자 하는 경우 device가 일치하지 않는다는 error가 뜨는 경우가 존재함. 이는, torch.save를 통해서 모델을 가져올 때 map location을 지정해주지 않아서 생기는 문제. torch DDP docs를 보다가 아래와 같은 note를 발견함. If you use torch.save on one process to checkpoint th..

728x90