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

Incompatibility with Python 3.9x or Numpy versions. #19

Open
theholymath opened this issue Apr 1, 2021 · 4 comments
Open

Incompatibility with Python 3.9x or Numpy versions. #19

theholymath opened this issue Apr 1, 2021 · 4 comments

Comments

@theholymath
Copy link

I am trying to explore the code and getting some incompatibility with python version 3.9 and/or my version of numpy 1.19.3

The trace:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-fab5524ebb5d> in <module>
----> 1 import pymde

/usr/local/lib/python3.9/site-packages/pymde/__init__.py in <module>
      5 from pymde.constraints import Centered, Anchored, Standardized
      6 
----> 7 from pymde import datasets
      8 
      9 from pymde.preprocess.graph import Graph

/usr/local/lib/python3.9/site-packages/pymde/datasets.py in <module>
     16 
     17 import numpy as np
---> 18 from pymde.preprocess.graph import Graph
     19 from pymde.problem import LOGGER
     20 import scipy.sparse as sp

/usr/local/lib/python3.9/site-packages/pymde/preprocess/__init__.py in <module>
      3 from pymde.preprocess.preprocess import scale
      4 
----> 5 from pymde.preprocess.generic import distances, k_nearest_neighbors
      6 
      7 from . import graph

/usr/local/lib/python3.9/site-packages/pymde/preprocess/generic.py in <module>
      3 import torch
      4 
----> 5 from pymde.preprocess import data_matrix
      6 from pymde.preprocess import graph
      7 

/usr/local/lib/python3.9/site-packages/pymde/preprocess/data_matrix.py in <module>
      4 
      5 from pymde import problem
----> 6 from pymde.preprocess.graph import Graph
      7 from pymde.preprocess.preprocess import sample_edges
      8 from pymde import util

/usr/local/lib/python3.9/site-packages/pymde/preprocess/graph.py in <module>
      9 from pymde import problem
     10 from pymde.functions import penalties, losses
---> 11 from pymde.preprocess import _graph
     12 
     13 

pymde/preprocess/_graph.pyx in init pymde.preprocess._graph()

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

Okay, upgraded to numpy==1.20 and it works now. Something weird with numpy 1.19 though.

@akshayka
Copy link
Member

akshayka commented Apr 1, 2021

Thanks for reporting. It might be the case that the wheels are built with 1.20, instead of the oldest supported numpy version. The way the build handles the NumPy version dependency right now is not ideal.

@afrendeiro
Copy link

Can confirm the same using Python3.9 and numpy==1.19.5, solved with numpy upgrade to 1.21.0.

@akshayka
Copy link
Member

akshayka commented Jul 3, 2021

PR #41 should fix this problem. I won't close this issue until a new version of PyMDE is deployed with the fix, though.

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