Skip to content

Installation failure for DLC 2.3.8 with deeplabcut[gui,tf,modelzoo] #2509

@huzaifa129

Description

@huzaifa129

Is there an existing issue for this?

  • I have searched the existing issues

Bug description

I am trying to install the updated version so i have uninstalled all previous versions, and anaconda too. Then reinstall from step 0.
Open Anaconda Prompt as Admin

  1. Git clone using git clone https://github.com/DeepLabCut/DeepLabCut.git
  2. Locate the DEEPLABCUT.yaml file and edit last line
  • pip:
    • "deeplabcut[gui,tf,modelzoo]"
  1. conda env create -f DEEPLABCUT.yaml (After moving to conda environments directory)

  2. conda activate DEEPLABCUT

  3. cd C:\Users______\Downloads\DeepLabCut\examples

  4. python testscript.py
    [Error1]
    This gives me an error message regarding Protobf.
    I fix this issue by upgrading protobuf and copy builder.py to another directory. and then downgrade again to same version.
    Following the instructions from(https://stackoverflow.com/questions/71759248/importerror-cannot-import-name-builder-from-google-protobuf-internal)

  5. Install the latest protobuf version (in this case is 4.25.2)
    pip install --upgrade protobuf

  6. Copy builder.py from .../Lib/site-packages/google/protobuf/internal to another folder on your computer (let's say 'Documents')

  7. Install a protobuf version that is compatible with your project (for me 3.19.6)
    pip install protobuf==3.19.6

  8. Copy builder.py from (let's say 'Documents') to Lib/site-packages/google/protobuf/internal
    Then re-run the testscript.py
    [Error2] which i am unable to fix at this moment.

Another solution I came up with was to install latest tensorflow and keras. Which launches the GUI but ends up with a [Error3]

Operating System

operating system
Windows 11 Pro

DeepLabCut version

dlc version
Loading DLC 2.3.8...

DeepLabCut mode

single animal

Device type

gpu
Nvidia Quadro RTX 4000

Steps To Reproduce

Open Anaconda Prompt as Admin

  1. Git clone using git clone https://github.com/DeepLabCut/DeepLabCut.git
  2. Locate the DEEPLABCUT.yaml file and edit last line
  • pip:
    • "deeplabcut[gui,tf,modelzoo]"
  1. conda env create -f DEEPLABCUT.yaml (After moving to conda environments directory)
  2. conda activate DEEPLABCUT
  3. cd C:\Users______\Downloads\DeepLabCut\examples
  4. python testscript.py
  5. Error

Relevant log output

Error1
__________________________
Traceback (most recent call last):
  File "C:\Users\_____\Downloads\DeepLabCut\examples\testscript.py", line 26, in <module>
    import deeplabcut
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\deeplabcut\__init__.py", line 16, in <module>
    import tensorflow as tf
  File "C:\Users\_____\AppData\Roaming\Python\Python39\site-packages\tensorflow\__init__.py", line 48, in <module>
    from tensorflow._api.v2 import __internal__
  File "C:\Users\_____\AppData\Roaming\Python\Python39\site-packages\tensorflow\_api\v2\__internal__\__init__.py", line 8, in <module>
    from tensorflow._api.v2.__internal__ import autograph
  File "C:\Users\_____\AppData\Roaming\Python\Python39\site-packages\tensorflow\_api\v2\__internal__\autograph\__init__.py", line 8, in <module>
    from tensorflow.python.autograph.core.ag_ctx import control_status_ctx # line: 34
  File "C:\Users\_____\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\autograph\core\ag_ctx.py", line 21, in <module>
    from tensorflow.python.autograph.utils import ag_logging
  File "C:\Users\_____\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\autograph\utils\__init__.py", line 17, in <module>
    from tensorflow.python.autograph.utils.context_managers import control_dependency_on_returns
  File "C:\Users\_____\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\autograph\utils\context_managers.py", line 19, in <module>
    from tensorflow.python.framework import ops
  File "C:\Users\_____\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\framework\ops.py", line 29, in <module>
    from tensorflow.core.framework import attr_value_pb2
  File "C:\Users\_____\AppData\Roaming\Python\Python39\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 5, in <module>
    from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\google\protobuf\internal\__init__.py)

_________________
Error 2
2024-02-06 16:06:37.595895: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
Traceback (most recent call last):
  File "C:\Users\_____\Downloads\DeepLabCut\examples\testscript.py", line 26, in <module>
    import deeplabcut
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\deeplabcut\__init__.py", line 16, in <module>
    import tensorflow as tf
  File "C:\Users\_____\AppData\Roaming\Python\Python39\site-packages\tensorflow\__init__.py", line 485, in <module>
    importlib.import_module("keras.src.optimizers")
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\keras\__init__.py", line 20, in <module>
    from keras import distribute
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\keras\distribute\__init__.py", line 18, in <module>
    from keras.distribute import sidecar_evaluator
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\keras\distribute\sidecar_evaluator.py", line 22, in <module>
    from keras.optimizers.optimizer_experimental import (
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\keras\optimizers\__init__.py", line 26, in <module>
    from keras.optimizers.legacy import adadelta as adadelta_legacy
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\keras\optimizers\legacy\adadelta.py", line 17, in <module>
    from keras.optimizers.optimizer_v2 import adadelta
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\keras\optimizers\optimizer_v2\adadelta.py", line 21, in <module>
    from keras.optimizers.optimizer_v2 import optimizer_v2
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\site-packages\keras\optimizers\optimizer_v2\optimizer_v2.py", line 103, in <module>
    @keras_export("keras.optimizers.Optimizer", metaclass=abc.ABCMeta)
TypeError: __init__() got an unexpected keyword argument 'metaclass'
________________
Error 3
  File "C:\ProgramData\anaconda3\envs\DEEPLABCUT\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tf_keras'

Anything else?

No response

Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions