pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

Pytorch3D failing to build

Open Simonmengzhe opened this issue 2 years ago • 2 comments

🐛 Bugs / Unexpected behaviors

I tried to use the method described here to install and import pytroch3d in a local jupyter notebook: https://pytorch3d.org/tutorials/render_textured_meshes

which is the following code:

import os import sys import torch need_pytorch3d=False try: import pytorch3d except ModuleNotFoundError: need_pytorch3d=True if need_pytorch3d: if torch.version.startswith("1.13.") and sys.platform.startswith("linux"): # We try to install PyTorch3D via a released wheel. pyt_version_str=torch.version.split("+")[0].replace(".", "") version_str="".join([ f"py3{sys.version_info.minor}_cu", torch.version.cuda.replace(".",""), f"_pyt{pyt_version_str}" ]) !pip install fvcore iopath !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html else: # We try to install PyTorch3D from source. !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz !tar xzf 1.10.0.tar.gz os.environ["CUB_HOME"] = os.getcwd() + "/cub-1.10.0" !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'

And I get the following error at the end of many requirement already satisfied: Requirement already satisfied: fvcore in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (0.1.5.post20221221) Requirement already satisfied: iopath in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (0.1.10) Requirement already satisfied: tabulate in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from fvcore) (0.9.0) Requirement already satisfied: Pillow in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from fvcore) (8.4.0) Requirement already satisfied: tqdm in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from fvcore) (4.62.3) Requirement already satisfied: pyyaml>=5.1 in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from fvcore) (6.0) Requirement already satisfied: numpy in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from fvcore) (1.20.3) Requirement already satisfied: termcolor>=1.1 in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from fvcore) (2.2.0) Requirement already satisfied: yacs>=0.1.6 in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from fvcore) (0.1.8) Requirement already satisfied: typing-extensions in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from iopath) (4.4.0) Requirement already satisfied: portalocker in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from iopath) (2.7.0) Looking in links: https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py39_cu117_pyt1131/download.html ERROR: Could not find a version that satisfies the requirement pytorch3d (from versions: none) ERROR: No matching distribution found for pytorch3d

My pytroch is at version 1.13.1, and when I tried building from source : !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz !tar xzf 1.10.0.tar.gz os.environ["CUB_HOME"] = os.getcwd() + "/cub-1.10.0" !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'

I fail to build pytroch 3d with the following output:

Requirement already satisfied: typing-extensions in /data/cornucopia/mx238/Anaconda/lib/python3.9/site-packages (from iopath->pytorch3d==0.7.2) (4.4.0) Building wheels for collected packages: pytorch3d Building wheel for pytorch3d (setup.py) ... error: subprocess-exited-with-error

... ╰─> pytorch3d

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

my cuda version is 10.2, but I cannot update it as I do not have a administrative access. I think I need to downgrade pytroch from 1.13.1 to some compatible version, but I am not sure whether that will help. Please give any insight into how this would work, thank you!

Simonmengzhe avatar Feb 20 '23 11:02 Simonmengzhe

You can try my repository for building packages and PyPI simple index and see if it works for you: https://github.com/facebookresearch/pytorch3d/discussions/1752

MiroPsota avatar Mar 07 '24 12:03 MiroPsota

You can try to get more info on what went wrong with !pip install -v 'git+facebookresearch/pytorch3d.git@stable' But yes, you will probably need to go back a few versions of PyTorch3D. Which version of PyTorch are you using? And are there particular parts of pytorch3d which you need?

bottler avatar Mar 18 '24 18:03 bottler