Problems with deeplabcut installation on Windows 10

deeplabcut

#1

Hi there,

I am trying to install deeplabcut 2.0 on Windows 10. I managed to install tensorflow and deeplab cut via pip in a virtualenvironment (deeplabcut).

However, when I try to run the reaching demo:
import deeplabcut
import tensorflow as tf
import os
from pathlib import Path
#create a variable to set the config.yaml file path:
path_config_file = os.path.join(os.getcwd(),‘Reaching-Mackenzie-2018-08-30/config.yaml’)

#let’s load some demo data, and create a training set (this function is not used when you create your own project):
deeplabcut.load_demo_data(path_config_file)

I get:

Loaded, now creating training data…

D:\DeepLabCut2.0\examples\Reaching-Mackenzie-2018-08-30\training-datasets\iteration-0\UnaugmentedDataSet_ReachingAug30  already exists!
Traceback (most recent call last):
  File "D:\deeplabcut\lib\site-packages\pandas\io\pytables.py", line 445, in __init__
    import tables  # noqa
  File "D:\deeplabcut\lib\site-packages\tables\__init__.py", line 131, in <module>
    from .file import File, open_file, copy_file
  File "D:\deeplabcut\lib\site-packages\tables\file.py", line 35, in <module>
    from . import hdf5extension
ImportError: DLL load failed: The specified procedure could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\deeplabcut\lib\site-packages\deeplabcut\create_project\demo_data.py", line 35, in load_demo_data
    deeplabcut.create_training_dataset(config, num_shuffles=1)
  File "D:\deeplabcut\lib\site-packages\deeplabcut\generate_training_dataset\trainingsetmanipulation.py", line 439, in create_training_dataset
    Data = merge_annotateddatasets(cfg,project_path,Path(os.path.join(project_path,trainingsetfolder)),windows2linux)
  File "D:\deeplabcut\lib\site-packages\deeplabcut\generate_training_dataset\trainingsetmanipulation.py", line 361, in merge_annotateddatasets
    data = pd.read_hdf((str(data_path / Path(i))+'/CollectedData_'+cfg['scorer']+'.h5'),'df_with_missing')
  File "D:\deeplabcut\lib\site-packages\pandas\io\pytables.py", line 349, in read_hdf
    store = HDFStore(path_or_buf, mode=mode, **kwargs)
  File "D:\deeplabcut\lib\site-packages\pandas\io\pytables.py", line 448, in __init__
    'importing'.format(ex=str(ex)))
ImportError: HDFStore requires PyTables, "DLL load failed: The specified procedure could not be found." problem importing

I can see that there is a problem with pytables. I installed pytables with pip install tables==3.4.4 and I can import it successfully.

Any ideas how to solve this issue?

Many thanks in advance!


#2

Hey Edgarbc,

This is a pandas (pytables link error). See e.g. https://github.com/pandas-dev/pandas/issues/19666

Cheers,
Alexander


#3

Thank you for the quick response. I tried to do the same as in the suggested thread:

pip uninstall h5py
pip install h5py=2.7.0

but no success. I will try to anaconda route and see if I manage to install it. In the meantime, I will continue using the old version of dlc.
Thanks again!


#4

Here is the solution:

I would strongly recommend using the supplied conda files! https://github.com/AlexEMG/DeepLabCut/tree/master/conda-environments


#5

The cause for this issue is that the Windows binary releases for the pytables and h5py packages on PyPI are not coordinated such that both packages often ship with incompatible versions of the HDF5 DLLs. See for example https://github.com/h5py/h5py/issues/1142 or https://github.com/PyTables/PyTables/issues/715. A workaround is to use binaries from other distributors such as conda-forge or https://www.lfd.uci.edu/~gohlke/pythonlibs/


#6

Thanks for the suggestion. I will try that and report back. Now I am trying the conda route, also having problems with that but I will start a separate thread for that so the methods dont get mixed up.

Thanks a lot again!


#7

Thank you very much for the suggestion. It solved the issue. What I did:

  1. Download pytables and h5py from https://www.lfd.uci.edu/~gohlke/pythonlibs/
  2. Installed them with pip (replacing the existing ones)
    done!

#8

PS - I added a how to for using the conda install options: https://github.com/AlexEMG/DeepLabCut/tree/master/conda-environments


#9

Yes, I noticed. Thanks for letting me know! I got my virtualenv and pip version working (thanks for your suggestions) but will test the Anaconda route again soon.