Ludwig: Error: numpy.core._multiarray_umath

Created on 5 Mar 2019  路  10Comments  路  Source: ludwig-ai/ludwig

Hello,

As per instruction - I installed the requirements.txt file, upgraded my tensorflow to 1.13 but I'm getting this error

Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 968, in _find_and_load
SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-03-05 02:29:12.004806: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr 

I checked online for similar issue and saw that it can be resolved by python -m pip install --upgrade numpy but when I did that, I got a different error which looks like current numpy bug.

from ._conv import register_converters as _register_converters
Traceback (most recent call last):
  File "/Users/sens3i/anaconda3/bin/ludwig", line 6, in <module>
    from ludwig.cli import main
  File "/Users/sens3i/anaconda3/lib/python3.6/site-packages/ludwig/__init__.py", line 16, in <module>
    from ludwig.api import LudwigModel
  File "/Users/sens3i/anaconda3/lib/python3.6/site-packages/ludwig/api.py", line 39, in <module>
    from ludwig.data.postprocessing import postprocess_df, postprocess
  File "/Users/sens3i/anaconda3/lib/python3.6/site-packages/ludwig/data/postprocessing.py", line 19, in <module>
    from ludwig.features.feature_registries import output_type_registry
  File "/Users/sens3i/anaconda3/lib/python3.6/site-packages/ludwig/features/feature_registries.py", line 33, in <module>
    from ludwig.features.image_feature import ImageBaseFeature
  File "/Users/sens3i/anaconda3/lib/python3.6/site-packages/ludwig/features/image_feature.py", line 24, in <module>
    from skimage.io import imread
  File "/Users/sens3i/anaconda3/lib/python3.6/site-packages/skimage/__init__.py", line 158, in <module>
    from .util.dtype import *
  File "/Users/sens3i/anaconda3/lib/python3.6/site-packages/skimage/util/__init__.py", line 7, in <module>
    from .arraycrop import crop
  File "/Users/sens3i/anaconda3/lib/python3.6/site-packages/skimage/util/arraycrop.py", line 8, in <module>
    from numpy.lib.arraypad import _validate_lengths
ImportError: cannot import name '_validate_lengths'

Please see https://github.com/scikit-image/scikit-image/issues/3551 - A member on the thread said to install scikit-image 0.14.2 which seem to resolve the issue.

I realized that my default scikit-image was 0.13.1, so I pip install scikit-image==0.14.2

Incase someone else run into this error, I hope this helps. Also, maybe the exact version of scikit-image used for ludwig should be added to the requirements.txt file. Thanks

easy feature request

Most helpful comment

python -m pip install --upgrade numpy and pip install scikit-image==0.14.2 solved the issue

All 10 comments

This is always messy with python, all this cascade dependencies that eventually break, and it's pretty hard to keep track of all the updates. Thanks for sharing your solution, I'll spend some time figuring out a good compromise for versions of the packages that is not too restrictive, but also doesn't break every time a new version of one package gets released.

python -m pip install --upgrade numpy and pip install scikit-image==0.14.2 solved the issue

Keeping this open so that people with the same issue may find it. In the v0.1.1 I'll make a decision about which versions to use explicitly in the requirements.

File "", line 968, in _find_and_load
SystemError: returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import/
I just got the same issue,I'am going to try the solution proposed by @Barath19 and see. thank you man.

Solved !!!

File "", line 968, in _find_and_load
SystemError: returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import/
I just got the same issue,I'am going to try the solution proposed by @Barath19 and see. thank you man.

Haha! I proposed that solution too! Glad you've solved it.

Also, try to install numpy separately, rather than installing via tensorflow.

This is solved in ludwig==0.1.1

thanks @Tejaf ....it worked
can u share ur approach for finding its solution

I uninstalled my numpy and reinstalled numpy==1.18.2 or numpy==1.18.3. Both solved this issue for me.

pip install numpy==1.18.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tommylees112 picture tommylees112  路  4Comments

samfultonschool picture samfultonschool  路  4Comments

w4nderlust picture w4nderlust  路  4Comments

bharatsewani1993 picture bharatsewani1993  路  4Comments

wschroederga picture wschroederga  路  6Comments