Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Debugging PyTorch Build

Suraj Subramanian edited this pageJul 24, 2023 ·1 revision
  • If you run into errors when runningpython setup.py develop, here are some debugging steps:

    1. Runprintf '#include <stdio.h>\nint main() { printf("Hello World");}'|clang -x c -; ./a.out to make sureyour CMake works and can compile this simple Hello World program without errors.
    2. Nuke yourbuild directory. Thesetup.py script compiles binaries into thebuild folder and caches manydetails along the way, which saves time the next time you build. If you're running into issues, you can alwaysrm -rf build from the toplevelpytorch directory and start over.
    3. If you have made edits to the PyTorch repo, commit any change you'd like to keep and clean the repo with thefollowing commands (note that cleanreally removes all untracked files and changes.):
      git submodule deinit -f.git clean -xdfpython setup.py cleangit submodule update --init --recursive# very important to sync the submodulespython setup.py develop# then try running the command again
    4. The main step withinpython setup.py develop is runningmake from thebuild directory. If you want toexperiment with some environment variables, you can pass them into the command:
      ENV_KEY1=ENV_VAL1[, ENV_KEY2=ENV_VAL2]* python setup.py develop
  • If you run into issue runninggit submodule update --init --recursive. Please try the following:

    • If you encounter an error such as

      error: Submodule 'third_party/pybind11' could not be updated

      check whether your Git local or global config file contains anysubmodule.* settings. If yes, remove them and try again.(please referencethis doc for more info).

    • If you encounter an error such as

      fatal: unable to access 'https://github.com/pybind11/pybind11.git': could not load PEM client certificate ...

      this is likely that you are using HTTP proxying and the certificate expired. To check if the certificate is valid, rungit config --global --list and search for config likehttp.proxysslcert=<cert_file>. Then check certificate valid date by running

      openssl x509 -noout -in<cert_file> -dates
    • If you encounter an error that some third_party modules are not checked out correctly, such as

      Could not find .../pytorch/third_party/pybind11/CMakeLists.txt

      remove anysubmodule.* settings in your local git config (.git/config of your pytorch repo) and try again.

  • If you're a Windows contributor, please check outBest Practices.

  • For help with any part of the contributing process, please don’t hesitate to utilize our Zoom office hours! See detailshere

I would love to contribute to PyTorch!

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp