Code Monkey home page Code Monkey logo

errors's Introduction

내가 만난 에러들

errors's People

Contributors

wondrive avatar

Watchers

 avatar

errors's Issues

Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized

에러

  • 에러 내용 : 두 군데에서 확인 가능했음
    1. 터미널
      Canceled future for execute_request message before replies were done
      현재 셀 또는 이전 셀에서 코드를 실행하는 동안 Kernel이 충돌했습니다.
    2. jupyter 로그
      Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
  • 원인: 중복 라이브러리 충돌

터미널 에러 내용으로 검색하니 메모리 할당 부족이라는 글밖에 없어서 삽질 좀 했다.

해결

다음 코드로 중복 라이브러리를 허용해준다.

import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'

바보짓 기록 - RuntimeError: mat1 and mat2 shapes cannot be multiplied (10240x5 and 400x120)

Error

RuntimeError: mat1 and mat2 shapes cannot be multiplied (10240x5 and 400x120)

Solution

보통 Conv2d -> FC layer로 넘어갈 때 flatten elements size를 제대로 안 맞춰줘서 그렇다.

근데 난 사이즈를 맞춰줬는데도 자꾸 뜬금없는 사이즈가 출력되는 것이다...
알고보니 x=를 쓰지 않아서 view()가 적용이 안 됐다..
바보짓이 너무 어처구니 없어서 기록..

  <😭>
    |
  ┘┘
image

(바보짓 기록) AttributeError at DataLoader

Error Message

-> train_loader = DataLoader(train_dataset, batch_size=4, shuffle=True)
AttributeError
  • AttributeError 외에 별다른 에러 메세지는 안 떴다. 그래서 더욱 원인을 알 수 없었다.
  • 삽질한 것: shuffle=False로 바꾸면 에러는 안 뜨길래 (대신 다른 문제는 생김.. next(iter~로 불러오는 게 안 됨) 그게 문제인줄 알았음

Solution

train_loader = DataLoader(dataset=train_dataset, batch_size=4, shuffle=True)
dataset= 라고 attrbute name 명시해주니까 해결됨

ERROR:root:Can't read file_path (error of 'read_roi' and 'pathlib' library)

Error

  • error message: ERROR:root:Can't read C:\workspace\datasets\file_name.roi
  • code

import read_roi
from pathlib import Path
file_path = Path('C:\workspace\datasets\file_name.roi')
read_roi.read_roi_file( file_path ) # this is recognized as 'Nonetype' object

  • cause: it seems that 'read_roi_file( )' cannot read 'Path' type, and It works with string type.

Solution

  • Wrap the path with 'str( )'
  • code example

read_roi.read_roi_file( str(file_path) )

RuntimeError: Given input size: (512x1x1). Calculated output size: (512x0x0). Output size is too small 에러 해결

Error message

RuntimeError: Given input size: (512x1x1). Calculated output size: (512x0x0). Output size is too small


Cause of Error

This error occurs when the input size is smaller than the kernel size.
In my case, I tried to run VGG16 on MNIST dataset, there were 5 pooling layers with 2x2 kernel.
The original image size of MNIST is 28x28, and it becomes 0x0 after 5th pooling layer.
So the 0x0 shaped feature map couldn't be put on remain layers.


Solution

You just need to make the image size bigger than the kernel size of pooling layer where error occurs.

  • Choice 1. To increase the size of input shape (i.e. input size of a image)
  • Choice 2. To decrease the kernel size of a pooling layer
  • Choice 3. To decrease the number of pooling layer

I choosed Choice 1.


For option 1, I added transforms.Resize() to increase the input_size of a image. (Pytorch)

# Data load
transform = transforms.Compose([transforms.Resize(32), transforms.ToTensor(), transforms.Normalize(mean=(0.5,), std=(0.5,))])
train_dataset = datasets.MNIST(download=True, root='./', train=True, transform=transform)
train_loader = DataLoader(train_dataset, batch_size=batch_size,shuffle=True, num_workers=0)

test_dataset = datasets.MNIST(download=True, root='./', train=False, transform=transform)
test_loader = DataLoader(test_dataset, batch_size=batch_size,shuffle=False, num_workers=0)

For option 2 & 3, you can consider the fomula that calulates the size(H, W) of a output feature.

  • H = (img_H - kernel) / stride + 1
  • W = (img_W - kernel) / stride + 1

UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 1128: illegal multibyte sequence

오류

- 오류 내용: UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 1128: illegal multibyte sequence

- 발생 상황: conda env에 Python 설치하면, 위 오류에 의해 pip 명령어 안 먹힘..

- 원인: encoding 문제. cp949(euc-kr)로 설정되어있는 것을 utf-8로 바꿔줘야 한다.
utf-8은 전 세계 언어를, euc-krcp949은 한국어만 표현할 수 있음.


해결

다음 두 가지 파일 수정.
단, 디렉토리는 로컬에 설치된 Python이 아닌, 오류가 발생한 env의 Python Lib여야 함.

1. C:\Users\유저이름\anaconda3\envs\yolov5\Lib\distutils\text_file.py
line #115 : encoding='utf-8' 추가
image

2. C:\Users\유저이름\anaconda3\envs\yolov5\Lib\configparser.py
line #695 : encoding='utf-8' 수정
image

The Pylance server crashed 5 times in the last 3 minutes

Error

- error message : The Pylance server crashed 5 times in the last 3 minutes

I tried reinstalling the 'Python Extension Pack' and 'Pylance' lib a few times, but it didn't work.

Solution

put the sentence below to the vscode setting file.

"python.pylanceLspNotebooksEnabled": false

  • Path to the vscode setting file: C:\Users\YOUR_OWN_DIR\AppData\Roaming\Code\User\settings.json

[ref] microsoft/pylance-release#3017 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.