새소식

Study/시행착오

[해결] ImportError: cannot import name 'NDArray' from 'numpy.typing'

  • -
728x90

Error message 

ImportError: cannot import name 'NDArray' from 'numpy.typing' (/opt/conda/lib/python3.7/site-packages/numpy/typing/init.py)

환경: Ubuntu 20.04, python 3.7, numpy 1.20.2

사용 목적: mmdetection 프레임워크에서 모델 추론

 전달 받은 모델을 추론만 돌려보려고 해서 mmdetection 내 환경 설정을 하고 모델을 돌리려니 이런 에러가 뜹니다. 

ImportError: cannot import name 'NDArray' from 'numpy.typing' (/opt/conda/lib/python3.7/site-packages/numpy/typing/init.py)
728x90

Solve

numpy 패키지의 버전 문제라고 해서 현재 numpy 버전 확인 후 1.21.0 으로 업데이트 한 뒤 잘 동작하는 것을 확인했습니다. 

728x90
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.