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

numpy.ufunc has the wrong size, try recompiling. Expected 192, got 216 #621

Closed
Mainak431 opened this issue Jan 22, 2019 · 11 comments
Closed

Comments

@Mainak431
Copy link

Importing the autosklearn . classification goes into this error.

import autosklearn.classification
File "/home/titan/Documents/autoenv/lib/python3.5/site-packages/autosklearn/classification.py", line 1, in
from autosklearn.estimators import AutoSklearnClassifier
File "/home/titan/Documents/autoenv/lib/python3.5/site-packages/autosklearn/estimators.py", line 5, in
from autosklearn.automl import AutoMLClassifier, AutoMLRegressor
File "/home/titan/Documents/autoenv/lib/python3.5/site-packages/autosklearn/automl.py", line 8, in
from ConfigSpace.read_and_write import pcs
File "/home/titan/Documents/autoenv/lib/python3.5/site-packages/ConfigSpace/init.py", line 33, in
from ConfigSpace.configuration_space import Configuration,
File "ConfigSpace/configuration_space.py", line 37, in init ConfigSpace.configuration_space
File "init.pxd", line 872, in init ConfigSpace.hyperparameters
ValueError: numpy.ufunc has the wrong size, try recompiling. Expected 192, got 216

@KEggensperger
Copy link
Contributor

Can you please try using numpy>=1.16.0? According to this issue this should solve the problem: automl/ConfigSpace#107

@mfeurer
Copy link
Contributor

mfeurer commented Jan 28, 2019

Could you please give details about your operating system, how you installed Auto-sklearn and its dependencies and how I can reproduce this issue? For the last step it would be best if you can start from a fresh virtual environment or conda environment.

@Mainak431
Copy link
Author

OS - Ubuntu 16.04

I installed using pip install and dependencies auto installed in the process.

New virtualenv was created before installing sklearn

import autosklearn.classification to regenerate the error.

@mfeurer
Copy link
Contributor

mfeurer commented Jan 28, 2019

This is a bit tough to debug for me as I don't have an ubuntu 16.04. I assume it's an issue with the compiler. I think that the numpy wheel is build with gcc 4.X, while your OS uses gcc 5.X and the compilations of both are not compatible. I don't really know how to solve this and you have to try yourself.

There are three suggestions on how to proceed:

  • Use conda/anaconda. We continuously test that this works.
  • Try numpy 1.16 as this might fix the issue as mentioned by @KEggensperger
  • debug further yourself

Sorry for not being able to give you a better advice.

@Mainak431
Copy link
Author

@mfeurer numpy 1.16 is not solving the issue.

@mfeurer
Copy link
Contributor

mfeurer commented Apr 1, 2019

Could you please check my comment here? Maybe that helps?

@cvphelps
Copy link

On Ubuntu 18.04 I had this error. Based on comments I just ran:

pip install --upgrade numpy==1.16.0

And without changing anything else it works! Thanks @KEggensperger

@hkandpal
Copy link

I have Python (Version 2.7 and 3.4) and Pandas installed on
Amazon Linux AMI release 2018.03

[ec2-user@ip ~]$ python -V
Python 2.7.16
[ec2-user@ip ~]$ python3 -V
Python 3.5.7

[ec2-user@ip ~]$ pip3 list
Package Version


awscli 1.16.105
botocore 1.12.95
colorama 0.3.9
cx-Oracle 6.4.1
Cython 0.29.16
docutils 0.14
ez-setup 0.9
jmespath 0.9.3
numexpr 2.6.6
numpy 1.15.0
pandas 0.17.0
pip 20.0.2
pyasn1 0.4.5
python-dateutil 2.7.3
pytz 2018.5
PyYAML 3.13
rsa 3.4.2
s3transfer 0.2.0
setuptools 46.1.3
six 1.11.0
SQLAlchemy 1.2.10
tables 3.4.4
urllib3 1.24.1

[ec2-user@ip ~]$ python3
Python 3.5.7 (default, Feb 10 2020, 19:00:53)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.

include pandas as pd
File "", line 1
include pandas as pd
^
SyntaxError: invalid syntax

Any idea why getting this error.

@mfeurer
Copy link
Contributor

mfeurer commented Apr 13, 2020

@hkandpal could you please describe how your post is related to this issue and Auto-sklearn?

@mfeurer
Copy link
Contributor

mfeurer commented May 18, 2020

Closing this as the issue is already one your old, appears to be resolved, and we have had two new releases since.

In case there are further issues with ConfigSpace compilation, a good explanation of what can go wrong is given in this issue: automl/ConfigSpace#141

@reginalluna
Copy link

@mfeurer

thank you. It solved the issue.

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

6 participants