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

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject #420

Closed
shappiron opened this issue Feb 4, 2022 · 2 comments
Labels

Comments

@shappiron
Copy link

shappiron commented Feb 4, 2022

Describe the bug
I created new conda environment and installed only scikit-fda (with all needed requirements). When I try to import skfda I got:

ValueError                                Traceback (most recent call last)
<ipython-input-1-7e246c0798e0> in <module>
      4 #import matplotlib.pyplot as plt
      5 
----> 6 import skfda
      7 from skfda.datasets import fetch_growth
      8 from skfda.exploratory.visualization import FPCAPlot

~/anaconda3/lib/python3.7/site-packages/skfda/__init__.py in <module>
     35 from .representation._functional_data import concatenate
     36 
---> 37 from . import representation, datasets, preprocessing, exploratory, misc, ml, \
     38     inference
     39 

~/anaconda3/lib/python3.7/site-packages/skfda/datasets/__init__.py in <module>
     13     fetch_weather,
     14 )
---> 15 from ._samples_generators import (
     16     make_gaussian,
     17     make_gaussian_process,

~/anaconda3/lib/python3.7/site-packages/skfda/datasets/_samples_generators.py in <module>
     10 from .. import FDataGrid
     11 from .._utils import RandomStateLike, _cartesian_product, _to_grid_points
---> 12 from ..misc import covariances
     13 from ..preprocessing.registration import normalize_warping
     14 from ..representation._typing import DomainRangeLike, GridPointsLike

~/anaconda3/lib/python3.7/site-packages/skfda/misc/__init__.py in <module>
----> 1 from . import covariances, kernels, lstsq, metrics, operators, regularization
      2 from ._math import (
      3     cumsum,
      4     exp,
      5     inner_product,

~/anaconda3/lib/python3.7/site-packages/skfda/misc/covariances.py in <module>
      7 import sklearn.gaussian_process.kernels as sklearn_kern
      8 
----> 9 from ..exploratory.visualization._utils import _create_figure, _figure_to_svg
     10 
     11 

~/anaconda3/lib/python3.7/site-packages/skfda/exploratory/__init__.py in <module>
      1 from . import depth
----> 2 from . import outliers
      3 from . import stats
      4 from . import visualization

~/anaconda3/lib/python3.7/site-packages/skfda/exploratory/outliers/__init__.py in <module>
      4 )
      5 from ._iqr import IQROutlierDetector
----> 6 from ._outliergram import OutliergramOutlierDetector
      7 from .neighbors_outlier import LocalOutlierFactor

~/anaconda3/lib/python3.7/site-packages/skfda/exploratory/outliers/_outliergram.py in <module>
      6 from ...representation import FDataGrid
      7 from ..depth._depth import ModifiedBandDepth
----> 8 from ..stats import modified_epigraph_index
      9 
     10 

~/anaconda3/lib/python3.7/site-packages/skfda/exploratory/stats/__init__.py in <module>
----> 1 from ._stats import (
      2     cov,
      3     depth_based_median,
      4     geometric_median,
      5     gmean,

~/anaconda3/lib/python3.7/site-packages/skfda/exploratory/stats/_stats.py in <module>
      8 from scipy.stats import rankdata
      9 
---> 10 from ...misc.metrics import Metric, l2_distance, l2_norm
     11 from ...representation import FData, FDataGrid
     12 from ..depth import Depth, ModifiedBandDepth

~/anaconda3/lib/python3.7/site-packages/skfda/misc/metrics/__init__.py in <module>
      1 """Metrics, norms and related utilities."""
      2 
----> 3 from ._elastic_metrics import (
      4     amplitude_distance,
      5     fisher_rao_distance,

~/anaconda3/lib/python3.7/site-packages/skfda/misc/metrics/_elastic_metrics.py in <module>
      6 import scipy.integrate
      7 
----> 8 from ...preprocessing.registration import (
      9     ElasticRegistration,
     10     normalize_warping,

~/anaconda3/lib/python3.7/site-packages/skfda/preprocessing/__init__.py in <module>
----> 1 from . import registration
      2 from . import smoothing
      3 from . import dim_reduction

~/anaconda3/lib/python3.7/site-packages/skfda/preprocessing/registration/__init__.py in <module>
      5 """
      6 
----> 7 from . import elastic, validation
      8 from ._landmark_registration import (
      9     landmark_registration,

~/anaconda3/lib/python3.7/site-packages/skfda/preprocessing/registration/elastic.py in <module>
      9 
     10 import scipy.integrate
---> 11 from fdasrsf.utility_functions import optimum_reparam
     12 
     13 from ... import FDataGrid

~/anaconda3/lib/python3.7/site-packages/fdasrsf/__init__.py in <module>
     20 del sys
     21 
---> 22 from .time_warping import fdawarp, align_fPCA, align_fPLS, pairwise_align_bayes, pairwise_align_functions
     23 from .time_warping import pairwise_align_bayes_infHMC
     24 from .plot_style import f_plot, rstyle, plot_curve, plot_reg_open_curve, plot_geod_open_curve, plot_geod_close_curve

~/anaconda3/lib/python3.7/site-packages/fdasrsf/time_warping.py in <module>
      7 import numpy as np
      8 import matplotlib.pyplot as plt
----> 9 import fdasrsf.utility_functions as uf
     10 import fdasrsf.bayesian_functions as bf
     11 import fdasrsf.fPCA as fpca

~/anaconda3/lib/python3.7/site-packages/fdasrsf/utility_functions.py in <module>
     19 from joblib import Parallel, delayed
     20 import numpy.random as rn
---> 21 import optimum_reparamN2 as orN2
     22 import optimum_reparam_N as orN
     23 import cbayesian as bay

src/optimum_reparamN2.pyx in init optimum_reparamN2()

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

To Reproduce
import skfda

import skfda
...

Version information

  • OS: Linux
  • Python version: 3.8
  • scikit-fda version: 0.7.1
@shappiron shappiron added the bug label Feb 4, 2022
@vnmabus
Copy link
Member

vnmabus commented Feb 4, 2022

I think this is the same as jdtuck/fdasrsf_python#20

Please, check if the workaround suggested in that issue works for you.

@shappiron
Copy link
Author

Thank you for the answer. I handle the problem by downgrading python to version 3.7. The other required packages are following versions:
numpy==1.21.5
numba==0.55.1
matplotlib==3.5.1
scipy==1.7.3
setuptools==50.3.0.post20201006
Cython==0.29.27
scikit-learn==1.0.2
multimethod==1.7
findiff==0.8.9
fdasrsf==2.3.7

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

No branches or pull requests

2 participants