Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import deeplabcut fails inside scipy #27

Closed
HugoStrand opened this issue Jan 29, 2020 · 4 comments
Closed

import deeplabcut fails inside scipy #27

HugoStrand opened this issue Jan 29, 2020 · 4 comments

Comments

@HugoStrand
Copy link

Dear all,

I have built the Docker image

git clone https://github.com/MMathisLab/Docker4DeepLabCut2.0
cd Docker4DeepLabCut2.0
docker image build -t deep_lab_cut .
docker run -it deep_lab_cut /bin/bash

and have tried some basic things on the command line. Doing

root@46e8194c5958:~# export DLClight=True
root@46e8194c5958:~# ipython
Python 3.6.3 (default, Oct  6 2017, 08:44:35) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import deeplabcut

Gives an import error inside of scipy trying to get a feature from numpy, see below.

Any ideas on how to fix this?

I seems like bumping up the scipy version in the container might help, apache/mxnet#17398.

Best regards,
Hugo

DLC loaded in light mode; you cannot use any GUI (labeling, relabeling and standalone GUI)
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-cfa4f159dfc5> in <module>()
----> 1 import deeplabcut

/usr/local/lib/python3.6/dist-packages/deeplabcut/__init__.py in <module>()
     41     print("Project loaded in colab-mode. Apparently Colab has trouble loading statsmodels, so the smoothing & outlier frame extraction is disabled. Sorry!")
     42 else:
---> 43     from deeplabcut.refine_training_dataset import extract_outlier_frames, merge_datasets
     44     from deeplabcut.post_processing import filterpredictions, analyzeskeleton
     45 

/usr/local/lib/python3.6/dist-packages/deeplabcut/refine_training_dataset/__init__.py in <module>()
     18     from deeplabcut.refine_training_dataset.auxfun_drag import *
     19 
---> 20 from deeplabcut.refine_training_dataset.outlier_frames import *

/usr/local/lib/python3.6/dist-packages/deeplabcut/refine_training_dataset/outlier_frames.py in <module>()
     14 from pathlib import Path
     15 import pandas as pd
---> 16 import statsmodels.api as sm
     17 from deeplabcut.utils import auxiliaryfunctions, visualization
     18 from deeplabcut.utils import frameselectiontools

/usr/local/lib/python3.6/dist-packages/statsmodels/api.py in <module>()
      5 from . import tools
      6 from .tools.tools import add_constant, categorical
----> 7 from . import regression
      8 from .regression.linear_model import OLS, GLS, WLS, GLSAR
      9 from .regression.recursive_ls import RecursiveLS

/usr/local/lib/python3.6/dist-packages/statsmodels/regression/__init__.py in <module>()
----> 1 from .linear_model import yule_walker
      2 
      3 from statsmodels.tools._testing import PytestTester
      4 
      5 __all__ = ['yule_walker', 'test']

/usr/local/lib/python3.6/dist-packages/statsmodels/regression/linear_model.py in <module>()
     38 import numpy as np
     39 from scipy.linalg import toeplitz
---> 40 from scipy import stats
     41 from scipy import optimize
     42 

/usr/local/lib/python3.6/dist-packages/scipy/stats/__init__.py in <module>()
    343 from .stats import *
    344 from .distributions import *
--> 345 from .morestats import *
    346 from ._binned_statistic import *
    347 from .kde import gaussian_kde

/usr/local/lib/python3.6/dist-packages/scipy/stats/morestats.py in <module>()
     10                    sqrt, ceil, floor, array, compress,
     11                    pi, exp, ravel, count_nonzero, sin, cos, arctan2, hypot)
---> 12 from numpy.testing.decorators import setastest
     13 
     14 from scipy._lib.six import string_types

ModuleNotFoundError: No module named 'numpy.testing.decorators'

The versions present in the container are:

In [2]: import numpy.version
In [4]: print(numpy.version.version)
1.18.1
In [7]: import scipy.version
In [8]: print(scipy.version.version)
1.0.0
@gpwakeford
Copy link

Any updates regarding this issue? I'm having this identical problem as well! Same system, error codes, and versions of python, tensorflow, and numpy.

@gpwakeford
Copy link

gpwakeford commented Feb 11, 2020

Hey @HugoStrand, I pip installed a different version of numpy, as recommended here #26 however now I get a different error.

Screenshot from 2020-02-11 12-20-39

Any help here would be great.

@gpwakeford
Copy link

Ugh, so sorry y'all (I'm obviously very new here to python and linux distributions). I wasn't setting "export DLClight=True" before python. That seems to have fixed it for me (for now)!

@MMathisLab
Copy link
Member

in DeepLabCut 2.1.6 numpy is pinned to 1.16.4; so create a new image and this should go away...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants