PAIR-code / lit

The Learning Interpretability Tool: Interactively analyze ML models to understand their behavior in an extensible and framework agnostic interface.
https://pair-code.github.io/lit
Apache License 2.0
3.46k stars 352 forks source link

Default docker install instructions shows scary errors and seems to fail... #1437

Open iislucas opened 5 months ago

iislucas commented 5 months ago

(MacBook Pro M1 2021. MacOS-14.4 + Docker - 4.28.0 (139021))

Following: https://github.com/pair-code/lit?tab=readme-ov-file#build-container-image

...
12.54      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 26.8 MB/s eta 0:00:00
12.65 Collecting tensorflow==2.10.0
12.70   Downloading tensorflow-2.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.9 kB)
12.74 Collecting tensorflow-datasets==4.8.0
12.80   Downloading tensorflow_datasets-4.8.0-py3-none-any.whl (5.2 MB)
13.63      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.2/5.2 MB 6.2 MB/s eta 0:00:00
13.71 ERROR: Ignored the following versions that require a different python version: 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10; 1.8.0 Requires-Python >=3.11
13.71 ERROR: Could not find a version that satisfies the requirement tensorflow-text==2.10.0 (from versions: none)
13.71 ERROR: No matching distribution found for tensorflow-text==2.10.0
13.71
13.71 [notice] A new release of pip is available: 23.0.1 -> 24.0
13.71 [notice] To update, run: pip install --upgrade pip
------
Dockerfile:36
--------------------
  34 |     # This step is slow as it installs many packages.
  35 |     COPY ./requirements*.txt ./
  36 | >>> RUN python -m pip install -r requirements.txt
  37 |
  38 |     # Copy the rest of the lit_nlp package
--------------------
ERROR: failed to solve: process "/bin/sh -c python -m pip install -r requirements.txt" did not complete successfully: exit code: 1
RyanMullins commented 5 months ago

Which Python version are you using? The requirements.txt file is pinned to Python v3.10

RyanMullins commented 5 months ago

Oh... I just saw the Apple M1 architecture note. That's the problem. We've pinned to older versions of TF and TF Text and they don't support M-chips, only x86 AFAIK, so the Docker image is probably being built to target ARM and failing to find anything compatible on PyPI. Will investigate further.

iislucas commented 5 months ago

lol, read the error Lucas! (I'm was using the default python installed by homebrew, 3.12)

I guess maybe we can improve the readme to make that dependency clearer ahead of time, so that the default setup on a modern machine doesn't error, e.g. by setting the command python3.10 instead of just python3.10?

iislucas commented 5 months ago

Your guess was right, even with python 3.10 MacBook m1 install gives this error:

ERROR: Ignored the following versions that require a different python version: 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10; 1.8.0 Requires-Python >=3.11
ERROR: Could not find a version that satisfies the requirement tensorflow==2.10.0 (from versions: 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1, 2.14.0rc0, 2.14.0rc1, 2.14.0, 2.14.1, 2.15.0rc0, 2.15.0rc1, 2.15.0, 2.15.1, 2.16.0rc0, 2.16.1)
ERROR: No matching distribution found for tensorflow==2.10.0
RyanMullins commented 5 months ago

Yeah... I'm working on Py3.11-3.12 support for v1.2. This will include relaxing some dependencies that will allow running examples on M-chips. We're running into some version conflicts internally though so this may take a few more weeks to resolve.

RyanMullins commented 5 months ago

@iislucas I think that the dependency changes in https://github.com/PAIR-code/lit/pull/1364 will address the Apple Silicon incompatibilities, but I still need to verify that.