파이썬
-
Python으로 Clean Code 작성하기알.쓸.코드/알.쓸.파.코(알아두면 쓸데있는 파이썬 코드) 2022. 4. 10. 14:08
Reference 아래 글을 참고하여 적는 글입니다. 대부분의 코드 예제는 아래 사이트에서 가져왔습니다. https://dzone.com/articles/10-must-know-patterns-for-writing-clean-code-with-1 Must-Know Patterns: Writing Clean Code W/Python - DZone Open Source Python is one of the cleanest programming languages. Yet developers still need to learn Python best practices to write clean code. dzone.com 캡쳐한 코드(검은 배경화면)는 facebook 깃헙에서 가져온 코드입니다. Clean Cod..
-
[Error] UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [[node model/stem_conv/Conv2D (defined at \AppData\Local\Temp/ipykernel..Setting & Error 2021. 9. 3. 15:44
jupyter notebook에서 코드를 돌리다가 다음과 같은 에러가 발생 UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [[node model/stem_conv/Conv2D (defined at \AppData\Local\Temp/ipykernel_3968/2063824942.py:160) ]] [Op:__inference_train_function_20024] Function call stack: train_function 자료 화면은 다음과 같음..
-
[Error] Expected tensor for argument #1 'indices' to have scalar type Long; but got torch.IntTensor instead (while checking arguments for embedding)Setting & Error 2021. 8. 11. 01:28
torch.from_numpy(np.random.randint(1, V, size=(batch, 10))) 를 torch.from_numpy(np.random.randint(1, V, size=(batch, 10))).long() 로 바꾼다. long() 붙이기 아래 사이트 참고 https://www.gitmemory.com/issue/nikitakit/self-attentive-parser/25/498689123 RuntimeError when trying to train a new model - self-attentive-parser Ask questionsRuntimeError when trying to train a new model First of all, thank you for sharing..
-
[Python] IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a numberSetting & Error 2021. 8. 11. 01:26
파이토치 0.5 이후 버전에서 0차원 텐서의 지수가 유효하지 않아서 발생하는 에러 https://github.com/NVIDIA/flownet2-pytorch/issues/113 invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number · Issue #113 · NVIDIA/flownet2 pytorch 1.0 python3 main.py --inference --model FlowNet2 --save_flow --inference_dataset ImagesFromFolder --inference_dataset_root ~/fs24_512/ --resume mycheckpoints/FlowN..
-
[Python] OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initializedSetting & Error 2021. 8. 11. 01:24
주피터 노트북으로 matplotlib을 사용해 그래프를 그리려는데 "kernel dead" 커널이 죽었음 아래와 같은 메시지가 떴음 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 O..