ysig / GraKeL

A scikit-learn compatible library for graph kernels
https://ysig.github.io/GraKeL/
Other
587 stars 96 forks source link

get_isomorphism assertion error #5

Closed xia0pin9 closed 5 years ago

xia0pin9 commented 5 years ago

I encountered another assertion error when using graphlet_sampling kernel.

  File "/usr/local/lib/python2.7/site-packages/grakel/graph_kernels.py", line 386, in fit_transform
    K = self.kernel_.fit_transform(X)
  File "/usr/local/lib/python2.7/site-packages/grakel/kernels/graphlet_sampling.py", line 300, in fit_transform
    self.fit(X)
  File "/usr/local/lib/python2.7/site-packages/grakel/kernels/kernel.py", line 123, in fit
    self.X = self.parse_input(X)
  File "/usr/local/lib/python2.7/site-packages/grakel/kernels/graphlet_sampling.py", line 417, in parse_input
    if self._graph_bins[k].isomorphic(sg):
  File "grakel/kernels/_isomorphism/bliss.pyx", line 365, in grakel.kernels._isomorphism.bliss.Graph.isomorphic
  File "grakel/kernels/_isomorphism/bliss.pyx", line 361, in grakel.kernels._isomorphism.bliss.Graph.get_isomorphism
AssertionError

Looks like the error was raised within bliss library. For GraKeL, maybe an easy fix is to catch the error of the following conditional check code if self._graph_bins[k].isomorphic(sg):

ysig commented 5 years ago

There was an error inside my modification of the bliss.pyx namely that the __lt__ function on kernels was not implemented correctly. A general correction was applied in graphlet sampling four days before you posted your issue so please install the latest grakel from the repository.

Thanks a lot for the feedback.