반응형

전체 글 823

[논문 읽기] Rethinking Zero-Shot Learning: A Conditional Visual Classification Perspective

Rethinking Zero-Shot Learning: A Conditional Visual Classification Perspective(2019) https://arxiv.org/abs/1909.05995 Rethinking Zero-Shot Learning: A Conditional Visual Classification Perspective Zero-shot learning (ZSL) aims to recognize instances of unseen classes solely based on the semantic descriptions of the classes. Existing algorithms usually formulate it as a semantic-visual correspond..

[논문 읽기] TCN(2019), Transferable Contrastive Network for Generalized Zero-Shot Learning

https://arxiv.org/abs/1908.05832 Transferable Contrastive Network for Generalized Zero-Shot Learning Zero-shot learning (ZSL) is a challenging problem that aims to recognize the target categories without seen data, where semantic information is leveraged to transfer knowledge from some source classes. Although ZSL has made great progress in recent years, arxiv.org Transferable Contrastive Networ..

[논문 읽기] CE-GZSL(2021), Contrastive Embedding for Generalized Zero-Shot Learning

https://arxiv.org/abs/2103.16173 Contrastive Embedding for Generalized Zero-Shot Learning Generalized zero-shot learning (GZSL) aims to recognize objects from both seen and unseen classes, when only the labeled examples from seen classes are provided. Recent feature generation methods learn a generative model that can synthesize the missing vis arxiv.org Zero shot Learning은 보통 embedding based me..

[Pytorch Ligtning] RuntimeError: t == DeviceType::CUDAINTERNAL ASSERT FAILED at "/opt/conda/conda-bld/pytorch_1634272068694/work/c10/cuda/impl/CUDAGuardImpl.h":24, please report a bug to PyTorch.

RuntimeError: t == DeviceType::CUDAINTERNAL ASSERT FAILED at "/opt/conda/conda-bld/pytorch_1634272068694/work/c10/cuda/impl/CUDAGuardImpl.h":24, please report a bug to PyTorch. 에러가 발생했다. Pytorch Lightning을 사용하다 발생한 에러인데, torchmetric에서 불러온 PSNR 함수를 .cuda()로 보내지 않아 발생한 오류였다. Pytorch Lightning이 torchmetric에서 불러온 PSNR 함수를 자동으로 cuda로 전달하지 않나보다. psnr = PSNR().cuda()

[Error] h5py.FIle()에서 경고 메세지 H5pyDeprecationWarning: The default file mode will change to 'r'

h5py file을 불러오는 코드를 다음과 같이 작성했다. file = h5py.File(path2h5) train_data = file['data'][:].astype('float32') train_label = file['label'][:].astype('float32') file.close() 다음과 같은 경고 메세지가 발생 dataset.py:10: H5pyDeprecationWarning: The default file mode will change to 'r' (read-only) in h5py 3.0. To suppress this warning, pass the mode you need to h5py.File(), or set the global default h5.get_config()...

[Pytorch] Load state_dict로 인한 out of memory

back = Back().cuda() state_dict = torch.load(config['back_init_model']) back.load_state_dict(state_dict['state_dict']) 모델을 GPU에 올린뒤에 load 명령어로 state_dict 파일을 불러오고 모델.load_state_dict로 불러온 state_dict을 적용하면 GPU 메모리가 낭비된다. 즉 CUDA out of memory가 발생할 수 있다는 것. load_state_dict이 적용된 모델과 처음에 정의한 모델이 함께 GPU에 올라가서 발생한 문제인 것 같다. 먼저 CPU 에 모델을 올리고 나서 load_state_dict으로 state_dict을 적용한 후에 GPU에 올리면 된다. back = Bac..

[논문 읽기] ELECTRA, Pre-Training Text Encoders as Discriminators rather than Generator(2020)

ELECTRA: Pre-Training Text Encoders as Discriminators Rather Than Generators https://arxiv.org/abs/2003.10555 ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators Masked language modeling (MLM) pre-training methods such as BERT corrupt the input by replacing some tokens with [MASK] and then train a model to reconstruct the original tokens. While they produce good results ..

논문 읽기/NLP 2021.12.07

[PyTorch] RuntimeError("grad can be implicitly created only for scalar outputs")

UserWarning: Was asked to gather along dimension 0, but all input tensors were scalars; will instead unsqueeze and return a vector RuntimeError("grad can be implicitly created only for scalar outputs") 위와 같은 에러가 발생했다. loss.backward() 에서 발생했는데.. loss.shape = ([2]) 로 되어 있기 때문이다. 파이토치 DP를 쓰면서 loss가 gpu 수 만큼 반환하게 되어, vector를 출력하게 된 것이다. loss.backward()를 위해서는 loss가 scalar이어야 하낟. 따라서 loss.mean().backw..

반응형