-
Notifications
You must be signed in to change notification settings - Fork 52
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
Exception in CommunityWalker #121
Comments
Hi Heiko 👋 Are you on the most recent version of pyRDF2Vec? I seem to be unable to reproduce the error. However, I see that you only extract 500 (randomly sampled) walks, so it might be that this bug only occurs very sporadically. Could you perhaps add some np.random.seed() on top of your script to make it fully reproducible? It seems that at some point, a list (instead of a Vertex object) is appended to a walk. The walk thus probably looks somewhat like ([obj], v1, v2, v3, v3, ...), on which it crashes (the double edged sword of Python...). I cannot find it immediately however. A fix for this, that would also avoid these kind of problems in the future, would be to create a dedicated class Walk:
...
def add_hop(self, vertex):
if not isinstance(vertex, Vertex):
raise Exception Btw, for smaller datasets, setting the number of walks to |
Hil Gilles, I'm using the latest version that I get through pip install (0.2.3), but I haven't rebuilt a more recent version on my own. Actually, it seems to work with the Thanks for your help! 😃 |
It's definitely strange behaviour and it is a bug (so leaving this issue open until fixed). It unfortunately seems to only happen very sporadically and only in the DFS (not the BFS), so it will be a very fun bug to solve ;) Thanks for reporting this btw! |
🐛 Bug
CommunityWalker fails with an exception
Current Behavior
This is the message I get:
Steps to Reproduce
Minimal code snippet:
This example works with all other walk types (HALK, NGram, etc.), but not community walks.
Environment
The text was updated successfully, but these errors were encountered: