반응형

분류 전체보기 133

[WPF] DispatcherUnhandledException

일반적으로 오류 핸들을 할때 try catch 문을 많이 사용한다. 그러나 얼마나 디테일하게 작업을 했더라도 exception이 발생이 경우가 많다. 그렇다고 각 로직 전체에 try catch 문을 하자니 cost가 크다. DispatcherUnhandledException 는 wpf app에서 처리하지 못한 exception이 발생하면 처리해준다. App.xaml.cs에 아래와 같이 추가해준다. App.xaml에서 이벤트 핸들러를 통해 해주어도 되고, startup에 아래와 같이 물려도 된다. this.DispatcherUnhandledException += (s, ex) => { MessageBox.Show(ex.Exception.ToString()); ex.Handled = true; };

프로그래밍/WPF 2022.06.22

[오류 해결] 관리 디버깅 도우미 'ContextSwitchDeadlock'

좀 데이터가 큰 녀석을 CSV 로 만들다보니 아래와 같은 오류가 발생되었다. 관리 디버깅 도우미 'ContextSwitchDeadlock' : 'CLR에서 60초 동안 COM 컨텍스트 0x1500cf0에서 COM 컨텍스트 0x1500c38(으)로 전환하지 못했습니다. 대상 컨텍스트/아파트를 소유하는 스레드가 펌프 대기를 수행하지 않거나, Windows 메시지를 펌프하지 않고 매우 긴 실행 작업을 처리하고 있는 것 같습니다. 이러한 상황은 대개 성능에 부정적인 영향을 주며 응용 프로그램이 응답하지 않거나 시간이 흐름에 따라 메모리 사용이 증가하는 문제로 이어질 수도 있습니다. 이 문제를 방지하려면 모든 STA(Single Threaded Apartment) 스레드가 펌프 대기 기본 형식(예: CoWaitF..

[오류 해결] CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json>Elapsed:

아나콘다 환경에서 새롭게 환경을 아래와 같이 생성하려했다. conda create -n torch_test 근데 아래와 같은 오류를 뱉었다. CondaHTTPError: HTTP 000 CONNECTION FAILED for url Elapsed: - An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way. If your current network has https://www.anaconda.com blocked, please file a support request with your network engineeri..

[오류 해결] 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

pip로 설치하다보면 아래와 같은 에러가 날 때가 있다. 필자의 경우는 회사 컴퓨터로 하다보니 ssl 오류가 난다. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1122)'))': /whl/torch_stable.html 해결방법은 아래와 같다. pip --trusted-host..

[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..

[pytorch] 개발환경

Anaconda3 > Anaconda Prompt 실행 가상환경 conda create -n torch_book python=3.9.0 가상환경 리스트 conda env list 가상환경 활성화 activate torch_book 가상환경 삭제 conda env remove -n torch_book 커널 설치 pip install ipykernel 가상환경에 커널 연결 python -m ipykernel install --user --name torch_book --display-name "torch_book" 파이토치 설치 conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 -c pytorch 주피터 노트북 설치 pip install ..

반응형