rh-aiservices-bu / fraud-detection

https://rh-aiservices-bu.github.io/fraud-detection/
Apache License 2.0
17 stars 56 forks source link

Dependencies incompatible with the Recommended TensorFlow 2023.2 image #17

Closed adelton closed 8 months ago

adelton commented 11 months ago

When creating a workbench in OpenShift AI 2.5, the default and labelled Recommended version of the TensorFlow image is 2023.2.

However, with that image, running the first cell

!pip install onnx==1.12.0 \
        onnxruntime==1.16.1 \
        seaborn==0.13.0 \
        tf2onnx==1.13.0

in 1_experiment_train.ipynb yields

Collecting onnx==1.12.0
  Downloading onnx-1.12.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.1/13.1 MB 261.3 MB/s eta 0:00:00a 0:00:01
Collecting onnxruntime==1.16.1
  Downloading onnxruntime-1.16.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.2/6.2 MB 226.6 MB/s eta 0:00:00
Collecting seaborn==0.13.0
  Downloading seaborn-0.13.0-py3-none-any.whl (294 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 294.6/294.6 kB 483.0 MB/s eta 0:00:00
Collecting tf2onnx==1.13.0
  Downloading tf2onnx-1.13.0-py3-none-any.whl (442 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 442.3/442.3 kB 458.3 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.16.6 in /opt/app-root/lib/python3.9/site-packages (from onnx==1.12.0) (1.24.3)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /opt/app-root/lib/python3.9/site-packages (from onnx==1.12.0) (4.5.0)
Collecting protobuf<=3.20.1,>=3.12.2
  Downloading protobuf-3.20.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 502.8 MB/s eta 0:00:00
Collecting sympy
  Downloading sympy-1.12-py3-none-any.whl (5.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 196.8 MB/s eta 0:00:00
Collecting coloredlogs
  Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 kB 316.2 MB/s eta 0:00:00
Requirement already satisfied: packaging in /opt/app-root/lib/python3.9/site-packages (from onnxruntime==1.16.1) (23.2)
Requirement already satisfied: flatbuffers in /opt/app-root/lib/python3.9/site-packages (from onnxruntime==1.16.1) (23.5.26)
Requirement already satisfied: matplotlib!=3.6.1,>=3.3 in /opt/app-root/lib/python3.9/site-packages (from seaborn==0.13.0) (3.6.3)
Requirement already satisfied: pandas>=1.2 in /opt/app-root/lib/python3.9/site-packages (from seaborn==0.13.0) (1.5.3)
Collecting flatbuffers
  Downloading flatbuffers-2.0.7-py2.py3-none-any.whl (26 kB)
Requirement already satisfied: six in /opt/app-root/lib/python3.9/site-packages (from tf2onnx==1.13.0) (1.16.0)
Requirement already satisfied: requests in /opt/app-root/lib/python3.9/site-packages (from tf2onnx==1.13.0) (2.31.0)
Requirement already satisfied: pyparsing>=2.2.1 in /opt/app-root/lib/python3.9/site-packages (from matplotlib!=3.6.1,>=3.3->seaborn==0.13.0) (3.1.1)
Requirement already satisfied: fonttools>=4.22.0 in /opt/app-root/lib/python3.9/site-packages (from matplotlib!=3.6.1,>=3.3->seaborn==0.13.0) (4.44.0)
Requirement already satisfied: cycler>=0.10 in /opt/app-root/lib/python3.9/site-packages (from matplotlib!=3.6.1,>=3.3->seaborn==0.13.0) (0.12.1)
Requirement already satisfied: contourpy>=1.0.1 in /opt/app-root/lib/python3.9/site-packages (from matplotlib!=3.6.1,>=3.3->seaborn==0.13.0) (1.2.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /opt/app-root/lib/python3.9/site-packages (from matplotlib!=3.6.1,>=3.3->seaborn==0.13.0) (1.4.5)
Requirement already satisfied: pillow>=6.2.0 in /opt/app-root/lib/python3.9/site-packages (from matplotlib!=3.6.1,>=3.3->seaborn==0.13.0) (10.1.0)
Requirement already satisfied: python-dateutil>=2.7 in /opt/app-root/lib/python3.9/site-packages (from matplotlib!=3.6.1,>=3.3->seaborn==0.13.0) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /opt/app-root/lib/python3.9/site-packages (from pandas>=1.2->seaborn==0.13.0) (2023.3.post1)
Collecting humanfriendly>=9.1
  Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 kB 381.0 MB/s eta 0:00:00
Requirement already satisfied: certifi>=2017.4.17 in /opt/app-root/lib/python3.9/site-packages (from requests->tf2onnx==1.13.0) (2023.7.22)
Requirement already satisfied: charset-normalizer<4,>=2 in /opt/app-root/lib/python3.9/site-packages (from requests->tf2onnx==1.13.0) (3.3.2)
Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/app-root/lib/python3.9/site-packages (from requests->tf2onnx==1.13.0) (1.26.18)
Requirement already satisfied: idna<4,>=2.5 in /opt/app-root/lib/python3.9/site-packages (from requests->tf2onnx==1.13.0) (3.4)
Collecting mpmath>=0.19
  Downloading mpmath-1.3.0-py3-none-any.whl (536 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 536.2/536.2 kB 396.5 MB/s eta 0:00:00
Installing collected packages: mpmath, flatbuffers, sympy, protobuf, humanfriendly, onnx, coloredlogs, tf2onnx, seaborn, onnxruntime
  Attempting uninstall: flatbuffers
    Found existing installation: flatbuffers 23.5.26
    Uninstalling flatbuffers-23.5.26:
      Successfully uninstalled flatbuffers-23.5.26
  Attempting uninstall: protobuf
    Found existing installation: protobuf 3.20.3
    Uninstalling protobuf-3.20.3:
      Successfully uninstalled protobuf-3.20.3
  Attempting uninstall: onnx
    Found existing installation: onnx 1.15.0
    Uninstalling onnx-1.15.0:
      Successfully uninstalled onnx-1.15.0
  Attempting uninstall: tf2onnx
    Found existing installation: tf2onnx 1.15.1
    Uninstalling tf2onnx-1.15.1:
      Successfully uninstalled tf2onnx-1.15.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 2.13.1 requires flatbuffers>=23.1.21, but you have flatbuffers 2.0.7 which is incompatible.
tensorflow 2.13.1 requires protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3, but you have protobuf 3.20.1 which is incompatible.
googleapis-common-protos 1.61.0 requires protobuf!=3.20.0,!=3.20.1,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0.dev0,>=3.19.5, but you have protobuf 3.20.1 which is incompatible.
google-api-core 2.14.0 requires protobuf!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0.dev0,>=3.19.5, but you have protobuf 3.20.1 which is incompatible.
Successfully installed coloredlogs-15.0.1 flatbuffers-2.0.7 humanfriendly-10.0 mpmath-1.3.0 onnx-1.12.0 onnxruntime-1.16.1 protobuf-3.20.1 seaborn-0.13.0 sympy-1.12 tf2onnx-1.13.0

[notice] A new release of pip available: 22.2.2 -> 23.3.2
[notice] To update, run: pip install --upgrade pip

The step 4 in https://access.redhat.com/documentation/en-us/red_hat_openshift_ai_self-managed/2-latest/html-single/fraud_detection_tutorial/index#creating-a-workbench says "Select the latest Tensorflow image." and shows a selection of 2023.1 (Recommended).

But that is not possible with latest OpenShift AI -- either the user can select 2023.1, or the latest (and Recommended).

In any case, the notebook should work with the latest product version (and latest images) without errors.

adelton commented 11 months ago

But that is not possible with latest OpenShift AI -- either the user can select 2023.1, or the latest (and Recommended).

This part of the problem now reported as https://issues.redhat.com/browse/RHOAIENG-1054.

adelton commented 8 months ago

I now retried the tutorial with https://access.redhat.com/documentation/en-us/red_hat_openshift_ai_self-managed/2.7/html-single/openshift_ai_tutorial_-_fraud_detection_example/index#navigating-to-the-dashboard on OpenShift 4.15 and OpenShift AI 2.7 and the first cell content is

!pip install onnx onnxruntime seaborn tf2onnx

which passed.

adelton commented 8 months ago

Presumably this issue was fixed via https://github.com/rh-aiservices-bu/fraud-detection/pull/14.