Joonas' Note
[Windows 10] pytorch3d 설치 중 트러블 슈팅 본문
- 환경 세팅
- CL 명령어를 못 찾음
- 해결
- 참고
- build_ext 이후 에러
- 해결
- 참고
환경 세팅
프록시 설정 때문에 pip install pytorch3d 는 불가한 상황이었고, 공식 설치 문서를 참고해서 직접 패키지를 설치해야했다.
개인적으로 conda 를 잘 사용하지 않기도 하고, conda 세팅도 불가한 상황이라 virtualenv 로 실행 환경을 구축한 상황이다.
python -m virtualenv .venv
source .venv/Scripts/activate
python -m pip install pytorch torchvision pytorch-cuda
CL 명령어를 못 찾음
...
copying pytorch3d\datasets\shapenet\shapenet_synset_dict_v2.json -> build\lib.win-amd64-cpython-311\pytorch3d\datasets\shapenet
running build_ext
D:\MLTest\.venv\Lib\site-packages\torch\utils\cpp_extension.py:380: UserWarning: Error checking compiler version for cl: [WinError 2] 지정된 파일을 찾을 수 없습니다
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
error: [WinError 2] 지정된 파일을 찾을 수 없습니다
해결
Visual Studio Tools 에 있는 cl.exe 를 실행할 수 있도록 환경 변수 추가
export PATH=$PATH:/d/Programs/Visual\ Studio/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64
참고
Installed Visual Studio 2022 but 'cl' is not recognized as an internal or external command
None of my terminals on Windows 10 recognize cl 'as an internal or external command'. I have Visual Studio 2022 installed and I've tried it on every terminal, including terminals in the Visual Studio
stackoverflow.com
build_ext 이후 에러
adding license file 'LICENSE-3RD-PARTY'
writing manifest file 'pytorch3d.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
error: [WinError 2] 지정된 파일을 찾을 수 없습니다
해결
CUDA_HOME 또는 CUDA_PATH 환경 변수 설정
export CUDA_HOME=/d/Programs/NVIDIA\ Toolkits/CUDA/v12.4
환경 변수 설정하고 다시 실행해보면 다음 단계인 building 'pytorch3d._C' extension 를 시작한다.
참고
https://stackoverflow.com/a/77463619
running build_ext gives [W∈Error2]Thesystemca∩otf∈dthefi≤specif while building detectron2
I'm currently trying to build detectron2 in environment in Anaconda. Below is the packages that I'm using in my env: windows 11 conda package python 3.8 cuda 11.3 pytorch 1.11 torchaudio 0.11.0
stackoverflow.com
'개발 > python' 카테고리의 다른 글
한국 노래 가사(1964~2023년) 데이터 분석해보기 (0) | 2024.01.26 |
---|---|
[Python] 함수의 실행 속도 측정하기 (0) | 2023.01.27 |
[파이썬 패키지] 설치 없이 가벼운 데이터베이스 (json-as-db; JAD) (0) | 2023.01.27 |
VSCode에서 Python 버전 변경하기 (0) | 2023.01.11 |
아나콘다(Anaconda) 없이 가상환경 세팅하기 (0) | 2023.01.07 |