point bev env

Jae ha Lee·2024년 5월 26일

Conda를 사용할 수 없는 상황에서 pip만을 사용하여 environment.yaml에 정의된 환경을 설정하려면, environment.yaml에 나열된 패키지들을 개별적으로 설치해야 합니다. pip를 사용해 패키지들을 설치하는 방법을 아래에 설명하겠습니다.

우선, environment.yaml에 나열된 패키지들을 기반으로 requirements.txt 파일을 작성하고, 이를 통해 필요한 패키지들을 설치할 수 있습니다.

requirements.txt 파일 생성

environment.yaml 파일을 기반으로 requirements.txt 파일을 작성하세요. 다음은 이를 위한 샘플입니다:

# requirements.txt

# DL
torch<2.1.0
torchvision>=0.15.0
# torch-scatter, torch-sparse, torch-cluster는 별도로 설치

# Notebooks
jupyter

# Visualizations
matplotlib<3.8.0
plotly

# Datasets
nuscenes-devkit==1.1.0
lyft_dataset_sdk

# Format
black

# DL
timm
pytorch-lightning<2.0.0
torchmetrics<1.0.0
efficientnet_pytorch==0.7.1
einops
spconv-cu117

# Hydra
hydra-core==1.3.2
hydra-colorlog==1.2.0
hydra-optuna-sweeper==1.2.0

# ML
opencv-python
pyquaternion

# Logger
wandb
tensorboard

# Others
pyrootutils
pre-commit
click
rich
shapely==1.8.5
pytest

PyTorch Geometric 패키지 설치

PyTorch Geometric 패키지는 pip를 통해 설치할 수 있지만, 시스템의 PyTorch 버전과 CUDA 버전에 맞는 특정 URL을 통해 설치해야 합니다. PyTorch Geometric 공식 사이트의 지침에 따라 설치합니다:

pip install torch-scatter -f https://data.pyg.org/whl/torch-<torch_version>+cu<cuda_version>.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-<torch_version>+cu<cuda_version>.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-<torch_version>+cu<cuda_version>.html
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-<torch_version>+cu<cuda_version>.html
pip install torch-geometric

예: PyTorch 1.10.0과 CUDA 11.3을 사용하는 경우:

pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
pip install torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
pip install torch-cluster -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
pip install torch-geometric

전체 설치 명령어

이제 requirements.txt 파일과 PyTorch Geometric 패키지 설치 명령어를 사용하여 모든 패키지를 설치할 수 있습니다:

  1. requirements.txt 파일을 사용하여 패키지 설치:

    pip install -r requirements.txt
  2. PyTorch Geometric 패키지 설치:

    pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
    pip install torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
    pip install torch-cluster -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
    pip install torch-spline-conv -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
    pip install torch-geometric

마무리

이 과정을 통해 environment.yaml에 정의된 패키지들을 pip를 통해 설치할 수 있습니다. 각 패키지의 호환성 문제나 의존성 문제를 해결하기 위해 pip 설치 명령어를 적절히 조정해야 할 수도 있습니다. requirements.txt와 PyTorch Geometric 패키지를 설치한 후에도 특정 패키지가 누락되거나 버전 호환성 문제가 발생할 수 있으므로, 필요한 경우 개별 패키지를 추가로 설치하세요.

0개의 댓글