GithubHelp home page GithubHelp logo

IOError: bad message length about gae HOT 5 OPEN

tkipf avatar tkipf commented on May 26, 2024
IOError: bad message length

from gae.

Comments (5)

tkipf avatar tkipf commented on May 26, 2024

from gae.

chao92 avatar chao92 commented on May 26, 2024

I am meeting another problem:
Traceback (most recent call last):
File "train.py", line 48, in
adj_train, train_edges, val_edges, val_edges_false, test_edges, test_edges_false = mask_test_edges(adj)
File "build/bdist.linux-x86_64/egg/gae/preprocessing.py", line 99, in mask_test_edges
assert ~ismember(val_edges_false, edges_all)
AssertionError

from gae.

yjyGo avatar yjyGo commented on May 26, 2024

@chao92 I met the same problem: 'assert ~ismember(val_edges_false, edges_all) AssertionError', maybe is not uncommon. Do you resolve this matter?

from gae.

ioannisa92 avatar ioannisa92 commented on May 26, 2024

@yjyGo, @chao92 I know this is kind of late, but try and reduce the validation/test split. I did that and it worked for me.
I reduced it to 5%, because my graphs are kind of small. Not sure if this is the right thing to do.

I also tried with those asserts commented out. It still ran, but, again, that is probably not recommended/right to do

from gae.

delta2323 avatar delta2323 commented on May 26, 2024

@yjyGo @chao92 I have encountered the same problem. I found that the cause of this error is that false validation edges can be in the test edge set. However, the above assertion requires that false validation edges be in the whole edge set, including the test edge set. I think we can solve the problem if we also check that false validation edges are not in the test edge in generating them.

Code to reproduce (test.py)

import sys
import numpy as np
import scipy
import scipy.sparse as sp
from gae import preprocessing

print(f"python: {sys.version}")
print(f"numpy: {np.__version__}")
print(f"scipy: {scipy.__version__}")
np.random.seed(4)
A = sp.csr_matrix(np.random.randint(0, 2, (10, 10)))
A = sp.triu(A, 1)
A = A + A.T
preprocessing.mask_test_edges(A)

Changes in the GAE code (to check that false validation edges is in the test edge set)

%(master)[U]git diff      
diff --git a/gae/preprocessing.py b/gae/preprocessing.py
index 9b3b093..6c1f7f8 100644
--- a/gae/preprocessing.py
+++ b/gae/preprocessing.py
@@ -95,6 +95,10 @@ def mask_test_edges(adj):
                 continue
         val_edges_false.append([idx_i, idx_j])
 
+    assert ismember([6, 0], np.array(val_edges_false))
+    assert ismember([0, 6], test_edges)
+    assert ismember([0, 6], edges_all)
+
     assert ~ismember(test_edges_false, edges_all)
     assert ~ismember(val_edges_false, edges_all)
     assert ~ismember(val_edges, train_edges)

Log

%(master)[U]python test.py
python: 3.7.5 (default, Oct 25 2019, 10:52:18) 
[Clang 4.0.1 (tags/RELEASE_401/final)]
numpy: 1.18.1
scipy: 1.3.3
Traceback (most recent call last):
  File "test.py", line 17, in <module>
    preprocessing.mask_test_edges(A)
  File "/Users/oonokenta/dev/gae/gae/preprocessing.py", line 103, in mask_test_edges
    assert ~ismember(val_edges_false, edges_all)
AssertionError

from gae.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.