heaphop30 / graph-attention-nets Goto Github PK
View Code? Open in Web Editor NEWImplementation of MoNet (mixture model CNN) and GAT (Graph Attention Network) tested on MNIST and Cora datasets using Tensorflow 2.0.
Implementation of MoNet (mixture model CNN) and GAT (Graph Attention Network) tested on MNIST and Cora datasets using Tensorflow 2.0.
Hello Sir,
I was using your code of MoNet on custom demo dataset and faced following error:
please help me in removing it.
Layer 0: M_0 = |V| = 976 nodes (192 added), |E| = 3198 edges
Layer 1: M_1 = |V| = 488 nodes (79 added), |E| = 1448 edges
Layer 2: M_2 = |V| = 244 nodes (27 added), |E| = 687 edges
Layer 3: M_3 = |V| = 122 nodes (5 added), |E| = 343 edges
Layer 4: M_4 = |V| = 61 nodes (0 added), |E| = 160 edges
(32, 976, 1)
Traceback (most recent call last):
File "", line 1, in
runfile('E:/MOdels_for_multilabel/graph-attention-nets-master/core/MoNet_chest.py', wdir='E:/MOdels_for_multilabel/graph-attention-nets-master/core')
File "C:\Users\dell\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile
execfile(filename, namespace)
File "C:\Users\dell\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "E:/MOdels_for_multilabel/graph-attention-nets-master/core/MoNet_chest.py", line 895, in
model.fit(x_train, y_train, validation_data=(x_test, y_test), epochs=epochs)
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py", line 108, in _method_wrapper
return method(self, *args, **kwargs)
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1098, in fit
tmp_logs = train_function(iterator)
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\eager\def_function.py", line 780, in call
result = self._call(*args, **kwds)
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\eager\def_function.py", line 823, in _call
self._initialize(args, kwds, add_initializers_to=initializers)
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\eager\def_function.py", line 697, in _initialize
*args, **kwds))
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\eager\function.py", line 2855, in _get_concrete_function_internal_garbage_collected
graph_function, _, _ = self._maybe_define_function(args, kwargs)
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\eager\function.py", line 3213, in _maybe_define_function
graph_function = self._create_graph_function(args, kwargs)
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\eager\function.py", line 3075, in _create_graph_function
capture_by_value=self._capture_by_value),
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\framework\func_graph.py", line 986, in func_graph_from_py_func
func_outputs = python_func(*func_args, **func_kwargs)
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\eager\def_function.py", line 600, in wrapped_fn
return weak_wrapped_fn().wrapped(*args, **kwds)
File "C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\framework\func_graph.py", line 973, in wrapper
raise e.ag_error_metadata.to_exception(e)
ValueError: in user code:
C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py:806 train_function *
return step_function(self, iterator)
E:/MOdels_for_multilabel/graph-attention-nets-master/core/MoNet_chest.py:836 call *
weighting = self.weightings[k](X)
E:/MOdels_for_multilabel/graph-attention-nets-master/core/MoNet_chest.py:797 call *
X_t = tf.reshape(tf.transpose(X, [1,2,0]), [n_nodes, batch_size * n_features])
C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\util\dispatch.py:201 wrapper **
return target(*args, **kwargs)
C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\ops\array_ops.py:195 reshape
result = gen_array_ops.reshape(tensor, shape, name)
C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_array_ops.py:8234 reshape
"Reshape", tensor=tensor, shape=shape, name=name)
C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py:744 _apply_op_helper
attrs=attr_protos, op_def=op_def)
C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\framework\func_graph.py:593 _create_op_internal
compute_device)
C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py:3485 _create_op_internal
op_def=op_def)
C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py:1975 __init__
control_input_ops, op_def)
C:\Users\dell\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py:1815 _create_c_op
raise ValueError(str(e))
ValueError: Cannot reshape a tensor with 31232 elements to shape [976,1] (976 elements) for '{{node sequential/mo_net/weighting/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32](sequential/mo_net/weighting/transpose, sequential/mo_net/weighting/Reshape/shape)' with input shapes: [976,1,32], [2] and with input tensors computed as partial shapes: input[1] = [976,1].
In the class Attention in gat.ipynb, the shape of self.W is (F_1,F), I think that F_1 is the output_dim, so the shape should be (F,F_1). Is this right?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.