반응형

pytorch 3

[Pytorch] Variable 에 관하여

책이나 예제를 보면 아래와 같이 Variable 처리를 하는 내용이 종종 나온다. from torch.autograd import Variable h_0 = Variable(torch.zeros(self.num_layers * 2, x.size(0), self.hidden_size).to(device)) 일단 책의 내용은 Variable로 감싸진 텐서는 .backward()가 호출될때 자동으로 기울기가 계산된다라고 설명이 되어있다. 그래서 기울기 계산이 안되면 어떤 일이 벌어질까 싶어서 Variable을 제거해 보았고 분명 기울기가 계산이 안되면 문제가 발생해야하는데 결과는 이전과 같았다. 그래서 찾아본 결과가 아래와 같다. https://pytorch.org/docs/stable/autograd.htm..

[오류 해결] OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.

Python 으로 pyplot을 할때 가끔 아래와 같은 에러가 난다. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the pr..

반응형