Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling TorchVision

  1. Obtain the TorchVision source code.
    1
    git clone https://github.com/pytorch/vision.git -b v0.19.0 --depth 1
    

    You need to obtain a mapping TorchVision version. For details, see Table 1.

  2. Go to the vision directory, and compile and install TorchVision.
    1
    2
    cd vision
    python3 setup.py bdist_wheel
    

    After the installation is complete, the torchvision*.whl file is generated in the dist directory.

  3. Verify the installation.
    1
    2
    pip3 install dist/torchvision*.whl
    python3
    

    Run the following commands:

    1
    2
    import torchvision
    print(torchvision.__version__)
    

    If the version information is displayed, the installation is successful.