Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tensorflow==2.13 version incompatible in sleap[pypi]==1.3.2 #1495

Closed
roomrys opened this issue Sep 12, 2023 Discussed in #1483 · 1 comment
Closed

tensorflow==2.13 version incompatible in sleap[pypi]==1.3.2 #1495

roomrys opened this issue Sep 12, 2023 Discussed in #1483 · 1 comment

Comments

@roomrys
Copy link
Collaborator

roomrys commented Sep 12, 2023

Discussed in #1483

Originally posted by Jaspermoray September 11, 2023
Hi!

I'm using colab to do all of sleap's functions, and recently everything broke, I assume because of recent updates. At the moment, I'm getting a tensorflow issue:

2023-09-11 15:16:22.581609: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/usr/local/bin/sleap-train", line 5, in <module>
    from sleap.nn.training import main
  File "/usr/local/lib/python3.10/dist-packages/sleap/__init__.py", line 14, in <module>
    import sleap.nn
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/__init__.py", line 1, in <module>
    import sleap.nn.architectures
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/architectures/__init__.py", line 7, in <module>
    from sleap.nn.architectures import pretrained_encoders
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/architectures/pretrained_encoders.py", line 47, in <module>
    from sleap.nn.data.normalization import ensure_rgb
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/data/__init__.py", line 2, in <module>
    from sleap.nn.data import confidence_maps
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/data/confidence_maps.py", line 6, in <module>
    from sleap.nn.data.utils import make_grid_vectors
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/data/utils.py", line 4, in <module>
    from keras.utils import tf_utils
ImportError: cannot import name 'tf_utils' from 'keras.utils' (/usr/local/lib/python3.10/dist-packages/keras/utils/__init__.py)
INFO:numexpr.utils:NumExpr defaulting to 2 threads.
2023-09-11 15:16:27.665644: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-09-11 15:16:29.125970: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
  File "/usr/local/bin/sleap-train", line 5, in <module>
    from sleap.nn.training import main
  File "/usr/local/lib/python3.10/dist-packages/sleap/__init__.py", line 14, in <module>
    import sleap.nn
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/__init__.py", line 1, in <module>
    import sleap.nn.architectures
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/architectures/__init__.py", line 7, in <module>
    from sleap.nn.architectures import pretrained_encoders
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/architectures/pretrained_encoders.py", line 47, in <module>
    from sleap.nn.data.normalization import ensure_rgb
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/data/__init__.py", line 2, in <module>
    from sleap.nn.data import confidence_maps
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/data/confidence_maps.py", line 6, in <module>
    from sleap.nn.data.utils import make_grid_vectors
  File "/usr/local/lib/python3.10/dist-packages/sleap/nn/data/utils.py", line 4, in <module>
    from keras.utils import tf_utils
ImportError: cannot import name 'tf_utils' from 'keras.utils' (/usr/local/lib/python3.10/dist-packages/keras/utils/__init__.py)

A cursory google told me that its probably a incompatibility with tensorflow and keras, but I don't want to download and use versions that may not be compatible with sleap's other code. So can anybody help?


I'm looking into the issue. To keep from halting, change the pip install sleap[pypi] command to the previous release for the time being pip install sleap==1.3.1. I've also updated all the notebooks online to reflect this in e4fca4f.


Some changes between 1.3.2 and 1.3.1:

pip install sleap[pypi] pip install sleap==1.3.1
keras==2.8.0 keras==2.8.0
Keras-Applications==1.0.8 Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2 Keras-Preprocessing==1.1.2
tensorboard==2.13.0 tensorboard==2.8.0
tensorboard-data-server==0.7.1 tensorboard-data-server==0.6.1
--- tensorboard-plugin-wit==1.8.1
tensorflow==2.13.0 tensorflow==2.8.4
tensorflow-datasets==4.9.2 tensorflow-datasets==4.9.2
tensorflow-estimator==2.13.0 tensorflow-estimator==2.8.0
tensorflow-gcs-config==2.13.0 tensorflow-gcs-config==2.13.0
tensorflow-hub==0.14.0 tensorflow-hub==0.14.0
tensorflow-io-gcs-filesystem==0.33.0 tensorflow-io-gcs-filesystem==0.33.0
tensorflow-metadata==1.14.0 tensorflow-metadata==1.14.0
tensorflow-probability==0.20.1 tensorflow-probability==0.20.1
tensorstore==0.1.41 tensorstore==0.1.41

Doing a !pip install tensorflow==2.8.4 after the SLEAP installation fixes the problem... Wondering how the wheel test missed this as we definitely run a training test. Looking at the logs, the wheel test prefers tensorflow==2.11 whereas colab seems to come pre-installed with the latest tensorflow==2.13. We are adding some restrictions in #1485.

@roomrys roomrys changed the title Tensorflow/Keras issue? tensorflow==2.13 version incompatible in sleap[pypi]==1.3.2 Sep 12, 2023
@roomrys
Copy link
Collaborator Author

roomrys commented Sep 18, 2023

Hi @Jaspermoray,

We released a new version last week which aimed to address your issue. Things should be back in order now!

Thanks,
Liezl

@roomrys roomrys closed this as completed Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant