디버깅 노트

Key already registered with the same priority: GroupSpatialSoftmax

HyunJung_Jo 2021. 10. 20. 15:05

chemprop train 모듈 돌리는데 에러났다... 

구글링 해보니 이런게 나오네

https://discuss.pytorch.org/t/importerror-key-already-registered-with-the-same-priority/86271/2

 

importError:Key already registered with the same priority

How did you install PyTorch? Did you install the binaries or build form source? Are you using the GroupSpatialSoftmax in a standalone module or just from pytorch/modules/detectron?

discuss.pytorch.org

결국엔 토치를 지워도 남아 있는 파일들 때문에 그렇다더라~ 라는데, 난 지운 적도 없고 다른 가상환경에 토치 깐거 밖에 없는데 왜 그런지 모르겠다. 

 

일단

1. 토치와 관련 패키지들 싹 다 지우고 

2. anaconda3/envs/env_name/Lib/site-packages에서 torch 관련 폴더 다 지우고

3. 깔끔하게 다시 토치를 깔았다

 

그리고 실험코드 돌리니 깔끔하게 되더라 (공홈 참조)

>>> import torch
>>> x = torch.rand(5,3)
>>> print(x)
tensor([[0.6271, 0.9625, 0.7984],
        [0.3431, 0.9080, 0.8788],
        [0.3269, 0.1137, 0.3867],
        [0.5320, 0.2974, 0.5740],
        [0.0433, 0.4997, 0.0640]])
>>> torch.cuda.is_available()
True
>>>