Deeplabcut with GPU support

I’m trying to run deeplabcut with GPU support using Anaconda.

I was able to install tensorflow, but every time that I try to import deeplabcut it reports an error, I’m going to copy here what it says.

Can you help me? I’m not familiar with coding.

Thank you in advance

In [1]: import deeplabcut

---------------------------------------------------------------------------

ImportError                               Traceback (most recent call last)

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()

     57

---> 58   from tensorflow.python.pywrap_tensorflow_internal import *

     59   from tensorflow.python.pywrap_tensorflow_internal import __version__

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in <module>()

     27             return _mod

---> 28     _pywrap_tensorflow_internal = swig_import_helper()

     29     del swig_import_helper

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()

     23             try:

---> 24                 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)

     25             finally:

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\imp.py in load_module(name, file, filename, details)

    242         else:

--> 243             return load_dynamic(name, filename, file)

    244     elif type_ == PKG_DIRECTORY:

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\imp.py in load_dynamic(name, path, file)

    342             name=name, loader=loader, origin=path)

--> 343         return _load(spec)

    344

ImportError: DLL load failed: The specified procedure could not be found.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)

<ipython-input-1-52d2df9c7fa5> in <module>()

----> 1 import deeplabcut

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\__init__.py in <module>()

     27     else:

     28         mpl.use('Agg')

---> 29     from deeplabcut import generate_training_dataset

     30     from deeplabcut import refine_training_dataset

     31     from deeplabcut.generate_training_dataset import label_frames, dropannotationfileentriesduetodeletedimages, comparevideolistsanddatafolders

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\generate_training_dataset\__init__.py in <module>()

     17 else:

     18     from deeplabcut.generate_training_dataset.auxfun_drag_label import *

---> 19     from deeplabcut.generate_training_dataset.labeling_toolbox import *

     20     from deeplabcut.generate_training_dataset.multiple_individual_labeling_toolbox import *

     21     from deeplabcut.generate_training_dataset.frame_extraction_toolbox import *

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\generate_training_dataset\labeling_toolbox.py in <module>()

     25 import argparse

     26 from deeplabcut.generate_training_dataset import auxfun_drag_label

---> 27 from deeplabcut.utils import auxiliaryfunctions

     28 from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas

     29 from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as NavigationToolbar

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\utils\__init__.py in <module>()

----> 1 from deeplabcut.utils.make_labeled_video import *

      2 from deeplabcut.utils.auxiliaryfunctions import *

      3 from deeplabcut.utils.video_processor import *

      4 from deeplabcut.utils.plotting import *

      5

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\utils\make_labeled_video.py in <module>()

     36

     37 from deeplabcut.utils import auxiliaryfunctions

---> 38 from deeplabcut.pose_estimation_tensorflow.config import load_config

     39 from skimage.util import img_as_ubyte

     40 from skimage.draw import circle_perimeter, circle, line,line_aa

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\pose_estimation_tensorflow\__init__.py in <module>()

     11 from deeplabcut.pose_estimation_tensorflow.dataset import *

     12 from deeplabcut.pose_estimation_tensorflow.models import *

---> 13 from deeplabcut.pose_estimation_tensorflow.nnet import *

     14 from deeplabcut.pose_estimation_tensorflow.util import *

     15

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\pose_estimation_tensorflow\nnet\__init__.py in <module>()

     12

     13 """

---> 14 from deeplabcut.pose_estimation_tensorflow.nnet.losses import *

     15 from deeplabcut.pose_estimation_tensorflow.nnet.net_factory import *

     16 from deeplabcut.pose_estimation_tensorflow.nnet.pose_net import *

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\deeplabcut\pose_estimation_tensorflow\nnet\losses.py in <module>()

      3 https://github.com/eldar/pose-tensorflow

      4 '''

----> 5 import tensorflow as tf

      6

      7 from tensorflow.python.ops import math_ops

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\tensorflow\__init__.py in <module>()

     22

     23 # pylint: disable=g-bad-import-order

---> 24 from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import

     25

     26 from tensorflow._api.v1 import app

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\tensorflow\python\__init__.py in <module>()

     47 import numpy as np

     48

---> 49 from tensorflow.python import pywrap_tensorflow

     50

     51 # Protocol buffers

c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()

     72 for some common reasons and solutions.  Include the entire stack trace

     73 above this error message when asking for help.""" % traceback.format_exc()

---> 74   raise ImportError(msg)

     75

     76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):

  File "c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>

    from tensorflow.python.pywrap_tensorflow_internal import *

  File "c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>

    _pywrap_tensorflow_internal = swig_import_helper()

  File "c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper

    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)

  File "c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\imp.py", line 243, in load_module

    return load_dynamic(name, filename, file)

  File "c:\users\vpaschoal\.conda\envs\dlc-windowsgpu\lib\imp.py", line 343, in load_dynamic

    return _load(spec)

ImportError: DLL load failed: The specified procedure could not be found.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace

above this error message when asking for help.​

Welcome to the forum, @vpaschoal! :smile:

From the error message, it looks like a TensorFlow installation issue. Issues such as this one suggest that you need to install tensorflow-gpu into your conda environment, and ensure your CUDA version matches what the package needs. Did you carefully follow the TensorFlow installation instructions for conda?

I did, I was able to install tensorflow-gpu successfully onto the conda environment, and the CUDA should match the package needs (maybe a bit above really). I thought it was something with the commands while trying to load deeplabcut that was not working.

And I saw that post, but I am already using Anaconda, and the CUDA version is the same between the computer and anaconda…