isl-org / isl-org/Open3D-ML

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

Open
#684 2 comments 0 reactions 0 assignees View on GitHub
build/install issue
Dominant language
Python
Stars
2.3k
Forks
365
Avg merge
4h 6m
Merged PRs (30d)
1

Description

### Checklist

- [x] I have searched for [similar issues](https://github.com/isl-org/Open3D-ML/issues).
- [x] I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [x] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `main` branch).

### 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

```shell
python -c "import open3d.ml.torch as ml3d"
File ".venv/lib/python3.11/site-packages/open3d/ml/torch/__init__.py", line 21, in
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
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

```markdown
- 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_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.