PythonOT/POT

Bug in FGW barycenter example

rflamary opened this issue · 1 comments

Describe the bug

We have a bug when running the FGW barycenter example (not in my local install or on github action but on circleci)

Unexpected failing examples:
/home/circleci/project/examples/gromov/plot_barycenter_fgw.py failed leaving traceback:
Traceback (most recent call last):
  File "/home/circleci/project/examples/gromov/plot_barycenter_fgw.py", line 164, in <module>
    Cs = [shortest_path(nx.adjacency_matrix(x, dtype=np.int_)) for x in X0]
  File "/home/circleci/project/examples/gromov/plot_barycenter_fgw.py", line 164, in <listcomp>
    Cs = [shortest_path(nx.adjacency_matrix(x, dtype=np.int_)) for x in X0]
  File "_shortest_path.pyx", line 198, in scipy.sparse.csgraph._shortest_path.shortest_path
  File "_shortest_path.pyx", line 588, in scipy.sparse.csgraph._shortest_path.dijkstra
ValueError: Buffer dtype mismatch, expected 'const int' but got 'long'

that appeared recently (no idea why and it tried different dtypes nothing works).

I changed the conf.py file to skip the example for the moment but we need to find a way to make it work.

When this is fixed we need to edit this line to remove the skip

'filename_pattern': 'plot_(?!barycenter_fgw)',

To Reproduce

Steps to reproduce the behavior:

Screenshots

Code sample

Expected behavior

Environment (please complete the following information):

  • OS (e.g. MacOS, Windows, Linux):
  • Python version:
  • How was POT installed (source, pip, conda):
  • Build command you used (if compiling from source):
  • Only for GPU related bugs:
    • CUDA version:
    • GPU models and configuration:
    • Any other relevant information:

Output of the following code snippet:

import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import ot; print("POT", ot.__version__)

Additional context

Solved in #495 by converting the matrix to dense...