Wie baue ich Pytorch aus der Quelle?Python

Python-Programme
Anonymous
 Wie baue ich Pytorch aus der Quelle?

Post by Anonymous »

Wenn ich PyTorch verwende, zeigt es, dass die von Pytorch und die System CUDA-Version verwendete CUDA-Version inkonsistent ist. Daher muss ich Pytorch aus Quelle wieder aufbauen.

Code: Select all

# Install dependency
pip install astunparse numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing_extensions future six requests dataclasses

# Download pytorch source code
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
# If you are updating an existing checkout
git submodule sync
git submodule update --init --recursive --jobs 0

# Build
# If you want to use pytorch with cuda, please `USE_CUDA=1`
python setup.py install

# Install torchvision from source
git clone --recursive --branch v0.11.1 https://github.com/pytorch/vision.git
cd vision
python setup.py install

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post