Skip to content

Open3D-ML installation guide leads to PyTorch / NumPy version conflicts #684

@yvyork

Description

@yvyork

Checklist

Steps to reproduce the issue

Hi,

I tried installing Open3D-ML with Python 3.11.13 following the steps in the README.

Steps I followed:

  1. Created a fresh venv with Python 3.11.13.
  2. Installed open3d via pip/uv.
  3. Installed the requirements from requirements-torch.txt (which currently specifies torch==2.7.1+cu126).

Problems encountered:

On import (import open3d.ml.torch as ml3d), I got:

Exception: Version mismatch: Open3D needs PyTorch version 2.2.*, but version 2.7.1+cu126 is installed!

After downgrading PyTorch to 2.2.2+cu121, I then hit a NumPy 2.x incompatibility:

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.3.3...

Fixing this required manually downgrading to numpy<2

Working combination
open3d==0.19.0
torch==2.2.2+cu121
torchvision==0.17.2+cu121
numpy==1.26.4

Suggestion:
It looks like the requirement file requirements-torch-cuda.txt in the repo specifies newer PyTorch versions (2.7.x) that are not compatible with the released Open3D builds. Could the docs / requirements be updated to reflect the supported PyTorch and NumPy versions? This would help new users avoid the mismatch errors.

Thanks a lot for your great work on Open3D!

Error message

python -c "import open3d.ml.torch as ml3d"
 File ".venv/lib/python3.11/site-packages/open3d/ml/torch/__init__.py", line 21, in <module>
    raise Exception('Version mismatch: Open3D needs PyTorch version {}, but '
Exception: Version mismatch: Open3D needs PyTorch version 2.2.*, but version 2.7.1+cu126 is installed!

 uv pip install torch==2.2.2+cu121 torchvision==0.17.2+cu121 --index-url https://download.pytorch.org/whl/cu121

 python -c "import open3d.ml.torch as ml3d"

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.3.3 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

  File ".venv/lib/python3.11/site-packages/torch/nn/modules/transformer.py", line 20, in <module>
    device: torch.device = torch.device(torch._C._get_default_device()),  # torch.device('cpu'),
.venv/lib/python3.11/site-packages/torch/nn/modules/transformer.py:20: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:84.)
  device: torch.device = torch.device(torch._C._get_default_device()),  # torch.device('cpu'),

 uv pip install "numpy<2"

Open3D, Python and System information

- Operating system: Windows 11 64-bit
- Python version: Python 3.11.13
- Open3D version: 0.19.0
- System type: x64
- Is this remote workstation?: no
- How did you install Open3D?: uv

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions