diff --git a/deeplabcut/gui/tabs/analyze_videos.py b/deeplabcut/gui/tabs/analyze_videos.py index 6d289430d2..60971f4c3e 100644 --- a/deeplabcut/gui/tabs/analyze_videos.py +++ b/deeplabcut/gui/tabs/analyze_videos.py @@ -115,12 +115,6 @@ def _generate_layout_other_options(self, layout): tmp_layout.addWidget(self.save_as_csv) - self.save_as_nwb = QtWidgets.QCheckBox("Save result(s) as nwb") - self.save_as_nwb.setCheckState(Qt.Unchecked) - self.save_as_nwb.stateChanged.connect(self.update_nwb_choice) - - tmp_layout.addWidget(self.save_as_csv) - # Filter predictions self.filter_predictions = QtWidgets.QCheckBox("Filter predictions") self.filter_predictions.setCheckState(Qt.Unchecked) @@ -223,10 +217,6 @@ def update_csv_choice(self, state): s = "ENABLED" if Qt.CheckState(state) == Qt.Checked else "DISABLED" self.root.logger.info(f"Save results as CSV {s}") - def update_nwb_choice(self, state): - s = "ENABLED" if Qt.CheckState(state) == Qt.Checked else "DISABLED" - self.root.logger.info(f"Save results as NWB {s}") - def update_filter_choice(self, state): s = "ENABLED" if Qt.CheckState(state) == Qt.Checked else "DISABLED" self.root.logger.info(f"Filtering predictions {s}") @@ -331,7 +321,6 @@ def run_enabled(self): videos = list(self.files) save_as_csv = self.save_as_csv.isChecked() - save_as_nwb = self.save_as_nwb.isChecked() filter_data = self.filter_predictions.isChecked() videotype = self.video_selection_widget.videotype_widget.currentText() try: @@ -382,10 +371,3 @@ def run_enabled(self): videos, listofvideos=True, ) - - if save_as_nwb: - deeplabcut.analyze_videos_converth5_to_nwb( - config, - videos, - listofvideos=True, - ) diff --git a/examples/COLAB/COLAB_3miceDemo.ipynb b/examples/COLAB/COLAB_3miceDemo.ipynb index 8b4b55452d..d914c409fc 100644 --- a/examples/COLAB/COLAB_3miceDemo.ipynb +++ b/examples/COLAB/COLAB_3miceDemo.ipynb @@ -32,7 +32,9 @@ "- a quick guide to maDLC: https://deeplabcut.github.io/DeepLabCut/docs/tutorial.html\n", "- a demo COLAB for how to use maDLC on your own data: https://github.com/DeepLabCut/DeepLabCut/blob/main/examples/COLAB/COLAB_maDLC_TrainNetwork_VideoAnalysis.ipynb\n", "\n", - "### To get started, please go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"\n" + "### To get started, please go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"\n", + "\n", + "As the COLAB environments were updated to CUDA 12.X and Python 3.11, we need to install DeepLabCut and TensorFlow in a distinct way to get TensorFlow to connect to the GPU." ] }, { @@ -43,11 +45,49 @@ }, "outputs": [], "source": [ - "# Installs a CUDA version compatible with tensorflow on COLAB\n", - "!apt update && apt install cuda-11-8\n", + "# Install TensorFlow, tensorpack and tf_slim versions compatible with DeepLabCut\n", + "!pip install \"tensorflow==2.12.1\" \"tensorpack>=0.11\" \"tf_slim>=1.1.0\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Downgrade PyTorch to a version using CUDA 11.8 and cudnn 8\n", + "# This will also install the required CUDA libraries, for both PyTorch and TensorFlow\n", + "!pip install torch==2.3.1 torchvision --index-url https://download.pytorch.org/whl/cu118" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install the latest version of DeepLabCut\n", + "!pip install \"git+https://github.com/DeepLabCut/DeepLabCut.git\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# As described in https://www.tensorflow.org/install/pip#step-by-step_instructions, \n", + "# create symbolic links to NVIDIA shared libraries:\n", + "!ln -svf /usr/local/lib/python3.11/dist-packages/nvidia/*/lib/*.so* /usr/local/lib/python3.11/dist-packages/tensorflow" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Important - Restart the Runtime for the updated packages to be imported!\n", "\n", - "# Install the latest DeepLabCut version:\n", - "!pip install \"deeplabcut[tf]\"" + "PLEASE, click \"restart runtime\" from the output above before proceeding!" ] }, { diff --git a/examples/COLAB/COLAB_DEMO_SuperAnimal.ipynb b/examples/COLAB/COLAB_DEMO_SuperAnimal.ipynb index 86cd980c73..4f63b51995 100644 --- a/examples/COLAB/COLAB_DEMO_SuperAnimal.ipynb +++ b/examples/COLAB/COLAB_DEMO_SuperAnimal.ipynb @@ -43,15 +43,15 @@ "\n", "## **Let's get going: install DeepLabCut into COLAB:**\n", "\n", - "*Also, be sure you are connected to a GPU: go to menu, click Runtime > Change Runtime Type > select \"GPU\"*\n" + "*Also, be sure you are connected to a GPU: go to menu, click Runtime > Change Runtime Type > select \"GPU\"*\n", + "\n", + "As the COLAB environments were updated to CUDA 12.X and Python 3.11, we need to install DeepLabCut and TensorFlow in a distinct way to get TensorFlow to connect to the GPU.\n" ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "id": "03ylSyQ4O9Ee" - }, + "metadata": {}, "outputs": [], "source": [ "!pip install deeplabcut==3.0.0rc5" diff --git a/examples/COLAB/COLAB_DEMO_mouse_openfield.ipynb b/examples/COLAB/COLAB_DEMO_mouse_openfield.ipynb index 306ee6b079..a81190bb53 100644 --- a/examples/COLAB/COLAB_DEMO_mouse_openfield.ipynb +++ b/examples/COLAB/COLAB_DEMO_mouse_openfield.ipynb @@ -42,7 +42,30 @@ "id": "txoddlM8hLKm" }, "source": [ - "## First, go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"" + "## First, go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"\n", + "\n", + "As the COLAB environments were updated to CUDA 12.X and Python 3.11, we need to install DeepLabCut and TensorFlow in a distinct way to get TensorFlow to connect to the GPU." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install TensorFlow, tensorpack and tf_slim versions compatible with DeepLabCut\n", + "!pip install \"tensorflow==2.12.1\" \"tensorpack>=0.11\" \"tf_slim>=1.1.0\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Downgrade PyTorch to a version using CUDA 11.8 and cudnn 8\n", + "# This will also install the required CUDA libraries, for both PyTorch and TensorFlow\n", + "!pip install torch==2.3.1 torchvision --index-url https://download.pytorch.org/whl/cu118" ] }, { @@ -51,8 +74,9 @@ "metadata": {}, "outputs": [], "source": [ - "# Installs a CUDA version compatible with tensorflow on COLAB\n", - "!apt update && apt install cuda-11-8" + "# As described in https://www.tensorflow.org/install/pip#step-by-step_instructions, \n", + "# create symbolic links to NVIDIA shared libraries:\n", + "!ln -svf /usr/local/lib/python3.11/dist-packages/nvidia/*/lib/*.so* /usr/local/lib/python3.11/dist-packages/tensorflow" ] }, { @@ -91,7 +115,7 @@ "source": [ "# Install the latest DeepLabCut version (this will take a few minutes to install all the dependencies!)\n", "%cd /content/cloned-DLC-repo/\n", - "!pip install \".[tf]\"" + "!pip install \".\"" ] }, { diff --git a/examples/COLAB/COLAB_DLC_ModelZoo.ipynb b/examples/COLAB/COLAB_DLC_ModelZoo.ipynb index 66e8f062aa..62a60077db 100644 --- a/examples/COLAB/COLAB_DLC_ModelZoo.ipynb +++ b/examples/COLAB/COLAB_DLC_ModelZoo.ipynb @@ -45,29 +45,60 @@ "\n", "## **Let's get going: install DeepLabCut into COLAB:**\n", "\n", - "*Also, be sure you are connected to a GPU: go to menu, click Runtime > Change Runtime Type > select \"GPU\"*" + "*Also, be sure you are connected to a GPU: go to menu, click Runtime > Change Runtime Type > select \"GPU\"*\n", + "\n", + "As the COLAB environments were updated to CUDA 12.X and Python 3.11, we need to install DeepLabCut and TensorFlow in a distinct way to get TensorFlow to connect to the GPU." ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "id": "q23BzhA6CXxu" - }, + "metadata": {}, + "outputs": [], + "source": [ + "# Install TensorFlow, tensorpack and tf_slim versions compatible with DeepLabCut\n", + "!pip install \"tensorflow==2.12.1\" \"tensorpack>=0.11\" \"tf_slim>=1.1.0\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ - "#click the play icon (this will take a few minutes to install all the dependencies!)\n", - "!apt update && apt install cuda-11-8\n", - "!pip install deeplabcut[tf,modelzoo]" + "# Downgrade PyTorch to a version using CUDA 11.8 and cudnn 8\n", + "# This will also install the required CUDA libraries, for both PyTorch and TensorFlow\n", + "!pip install torch==2.3.1 torchvision --index-url https://download.pytorch.org/whl/cu118" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install the latest version of DeepLabCut\n", + "!pip install \"git+https://github.com/DeepLabCut/DeepLabCut.git#egg=deeplabcut[modelzoo]\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# As described in https://www.tensorflow.org/install/pip#step-by-step_instructions, \n", + "# create symbolic links to NVIDIA shared libraries:\n", + "!ln -svf /usr/local/lib/python3.11/dist-packages/nvidia/*/lib/*.so* /usr/local/lib/python3.11/dist-packages/tensorflow" ] }, { "cell_type": "markdown", - "metadata": { - "id": "zYm6DljQB0Y7" - }, + "metadata": {}, "source": [ - "###proTip: be sure to click \"restart runtime button\" if it appears above ^" + "### Important - Restart the Runtime for the updated packages to be imported!\n", + "\n", + "PLEASE, click \"restart runtime\" from the output above before proceeding!" ] }, { diff --git a/examples/COLAB/COLAB_YOURDATA_TrainNetwork_VideoAnalysis.ipynb b/examples/COLAB/COLAB_YOURDATA_TrainNetwork_VideoAnalysis.ipynb index 4c4af5e240..989655c7a5 100644 --- a/examples/COLAB/COLAB_YOURDATA_TrainNetwork_VideoAnalysis.ipynb +++ b/examples/COLAB/COLAB_YOURDATA_TrainNetwork_VideoAnalysis.ipynb @@ -48,22 +48,51 @@ "id": "txoddlM8hLKm" }, "source": [ - "## First, go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"\n" + "## First, go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"\n", + "\n", + "As the COLAB environments were updated to CUDA 12.X and Python 3.11, we need to install DeepLabCut and TensorFlow in a distinct way to get TensorFlow to connect to the GPU." ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "colab": {}, - "colab_type": "code", - "id": "q23BzhA6CXxu" - }, + "metadata": {}, + "outputs": [], + "source": [ + "# Install TensorFlow, tensorpack and tf_slim versions compatible with DeepLabCut\n", + "!pip install \"tensorflow==2.12.1\" \"tensorpack>=0.11\" \"tf_slim>=1.1.0\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Downgrade PyTorch to a version using CUDA 11.8 and cudnn 8\n", + "# This will also install the required CUDA libraries, for both PyTorch and TensorFlow\n", + "!pip install torch==2.3.1 torchvision --index-url https://download.pytorch.org/whl/cu118" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install the latest version of DeepLabCut\n", + "!pip install \"git+https://github.com/DeepLabCut/DeepLabCut.git\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ - "#(this will take a few minutes to install all the dependences!)\n", - "!apt update && apt install cuda-11-8\n", - "!pip install \"deeplabcut[tf]\"" + "# As described in https://www.tensorflow.org/install/pip#step-by-step_instructions, \n", + "# create symbolic links to NVIDIA shared libraries:\n", + "!ln -svf /usr/local/lib/python3.11/dist-packages/nvidia/*/lib/*.so* /usr/local/lib/python3.11/dist-packages/tensorflow" ] }, { diff --git a/examples/COLAB/COLAB_maDLC_TrainNetwork_VideoAnalysis.ipynb b/examples/COLAB/COLAB_maDLC_TrainNetwork_VideoAnalysis.ipynb index c56a046553..3da23bd633 100644 --- a/examples/COLAB/COLAB_maDLC_TrainNetwork_VideoAnalysis.ipynb +++ b/examples/COLAB/COLAB_maDLC_TrainNetwork_VideoAnalysis.ipynb @@ -46,36 +46,51 @@ "id": "txoddlM8hLKm" }, "source": [ - "## First, go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"\n" + "## First, go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"\n", + "\n", + "As the COLAB environments were updated to CUDA 12.X and Python 3.11, we need to install DeepLabCut and TensorFlow in a distinct way to get TensorFlow to connect to the GPU." ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "id": "q23BzhA6CXxu" - }, + "metadata": {}, "outputs": [], "source": [ - "#(this will take a few minutes to install all the dependences!)\n", - "!apt update && apt install cuda-11-8\n", - "!pip install \"deeplabcut[tf]\"\n", - "%reload_ext numpy\n", - "%reload_ext scipy\n", - "%reload_ext matplotlib\n", - "%reload_ext mpl_toolkits" + "# Install TensorFlow, tensorpack and tf_slim versions compatible with DeepLabCut\n", + "!pip install \"tensorflow==2.12.1\" \"tensorpack>=0.11\" \"tf_slim>=1.1.0\"" ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "id": "-MVvZ13_FMvP" - }, + "metadata": {}, + "outputs": [], + "source": [ + "# Downgrade PyTorch to a version using CUDA 11.8 and cudnn 8\n", + "# This will also install the required CUDA libraries, for both PyTorch and TensorFlow\n", + "!pip install torch==2.3.1 torchvision --index-url https://download.pytorch.org/whl/cu118" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install the latest version of DeepLabCut\n", + "!pip install \"git+https://github.com/DeepLabCut/DeepLabCut.git\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ - "#a few colab specific things needed:\n", - "!pip install --upgrade scikit-image" + "# As described in https://www.tensorflow.org/install/pip#step-by-step_instructions, \n", + "# create symbolic links to NVIDIA shared libraries:\n", + "!ln -svf /usr/local/lib/python3.11/dist-packages/nvidia/*/lib/*.so* /usr/local/lib/python3.11/dist-packages/tensorflow" ] }, { diff --git a/examples/COLAB/COLAB_transformer_reID.ipynb b/examples/COLAB/COLAB_transformer_reID.ipynb index 1e15a01683..814852a296 100644 --- a/examples/COLAB/COLAB_transformer_reID.ipynb +++ b/examples/COLAB/COLAB_transformer_reID.ipynb @@ -32,20 +32,51 @@ "- a quick guide to maDLC: https://deeplabcut.github.io/DeepLabCut/docs/tutorial.html\n", "- a demo COLAB for how to use maDLC on your own data: https://github.com/DeepLabCut/DeepLabCut/blob/main/examples/COLAB/COLAB_maDLC_TrainNetwork_VideoAnalysis.ipynb\n", "\n", - "### To get started, please go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"\n" + "### To get started, please go to \"Runtime\" ->\"change runtime type\"->select \"Python3\", and then select \"GPU\"\n", + "\n", + "As the COLAB environments were updated to CUDA 12.X and Python 3.11, we need to install DeepLabCut and TensorFlow in a distinct way to get TensorFlow to connect to the GPU." ] }, { "cell_type": "code", "execution_count": null, - "metadata": { - "id": "HoNN2_0Z9rr_" - }, + "metadata": {}, + "outputs": [], + "source": [ + "# Install TensorFlow, tensorpack and tf_slim versions compatible with DeepLabCut\n", + "!pip install \"tensorflow==2.12.1\" \"tensorpack>=0.11\" \"tf_slim>=1.1.0\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Downgrade PyTorch to a version using CUDA 11.8 and cudnn 8\n", + "# This will also install the required CUDA libraries, for both PyTorch and TensorFlow\n", + "!pip install torch==2.3.1 torchvision --index-url https://download.pytorch.org/whl/cu118" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Install the latest version of DeepLabCut\n", + "!pip install \"git+https://github.com/DeepLabCut/DeepLabCut.git\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ - "# Install the latest DeepLabCut version:\n", - "!apt update && apt install cuda-11-8\n", - "!pip install \"deeplabcut[tf]\"" + "# As described in https://www.tensorflow.org/install/pip#step-by-step_instructions, \n", + "# create symbolic links to NVIDIA shared libraries:\n", + "!ln -svf /usr/local/lib/python3.11/dist-packages/nvidia/*/lib/*.so* /usr/local/lib/python3.11/dist-packages/tensorflow" ] }, { diff --git a/setup.py b/setup.py index 362626bdda..b799e03ba6 100644 --- a/setup.py +++ b/setup.py @@ -90,7 +90,8 @@ def pytorch_config_paths() -> list[str]: "openvino": ["openvino-dev==2022.1.0"], "docs": ["numpydoc"], "tf": [ - "tensorflow>=2.0,<=2.10", + "tensorflow>=2.0,<=2.10;platform_system=='Windows'", + "tensorflow>=2.0,<=2.12;platform_system!='Windows'", "tensorpack>=0.11", "tf_slim>=1.1.0", ], # Last supported TF version on Windows Native is 2.10