Skip to content

Conversation

@n-poulsen
Copy link
Contributor

This pull request sets the TensorFlow pin to version 2.10 for windows, and version <=2.12 for other OSs. It also updates the installation method for DeepLabCut in COLAB notebooks, to match current requirements. The updated install is faster than the old install. To TensorFlow 2.12 working with the GPU in COLAB, one needs to run (in this order):

# Cell 1 - Install the desired TensorFlow version, built for CUDA 11.8 and cudnn 8
!pip install "tensorflow==2.12.1" "tensorpack>=0.11" "tf_slim>=1.1.0"

# Cell 2 - Downgrade PyTorch to a version using CUDA 11.8 and cudnn 8
#   This should also install the required CUDA libraries, for both PyTorch and TensorFlow
!pip install torch==2.3.1 torchvision --index-url https://download.pytorch.org/whl/cu118

# Cell 3
# As described in https://www.tensorflow.org/install/pip#step-by-step_instructions:
# Create symbolic links to NVIDIA shared libraries
!ln -svf /usr/local/lib/python3.11/dist-packages/nvidia/*/lib/*.so* /usr/local/lib/python3.11/dist-packages/tensorflow

Then DeepLabCut can be installed with the desired version (e.g. pip install deeplabcut or pip install "git+https://github.com/DeepLabCut/DeepLabCut.git)

Closes #2839

Copy link
Contributor

@maximpavliv maximpavliv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks a lot @n-poulsen ! Let's merge !

@MMathisLab MMathisLab merged commit c483526 into main Feb 7, 2025
5 checks passed
@MMathisLab MMathisLab deleted the niels/tf_pin_linux branch February 7, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COLAB || AttributeError: BatchNormalization is not available with Keras 3.

4 participants