stellargraph icon indicating copy to clipboard operation
stellargraph copied to clipboard

ValueError: There must be at least one input with a non-zero neighbourhood dimension

Open chi2liu opened this issue 3 years ago • 0 comments

Describe the bug

A clear and concise description of what the bug is. ValueError Traceback (most recent call last) /tmp/ipykernel_152527/498788247.py in 1 # Build the model and expose input and output sockets of graphsage, for node pair inputs: ----> 2 x_inp, x_out = graphsage.in_out_tensors()

~/miniconda3/envs/3.7/lib/python3.7/site-packages/stellargraph/layer/graphsage.py in in_out_tensors(self, multiplicity) 1075 return self._node_model() 1076 elif multiplicity == 2: -> 1077 return self._link_model() 1078 else: 1079 raise RuntimeError(

~/miniconda3/envs/3.7/lib/python3.7/site-packages/stellargraph/layer/graphsage.py in _link_model(self) 1050 """ 1051 # Expose input and output sockets of the model, for source and destination nodes: -> 1052 x_inp_src, x_out_src = self._node_model() 1053 x_inp_dst, x_out_dst = self._node_model() 1054 # re-pack into a list where (source, target) inputs alternate, for link inputs:

~/miniconda3/envs/3.7/lib/python3.7/site-packages/stellargraph/layer/graphsage.py in _node_model(self) 1034 1035 # Output from GraphSAGE model -> 1036 x_out = self(x_inp) 1037 1038 # Returns inputs and outputs

~/miniconda3/envs/3.7/lib/python3.7/site-packages/stellargraph/layer/graphsage.py in call(self, xin) 1003 h_layer = xin 1004 for layer in range(0, self.max_hops): -> 1005 h_layer = apply_layer(h_layer, layer) 1006 1007 # Remove neighbourhood dimension from output tensors of the stack

~/miniconda3/envs/3.7/lib/python3.7/site-packages/stellargraph/layer/graphsage.py in apply_layer(x, num_hops) 987 # Apply aggregator to head node and neighbour nodes 988 layer_out.append( --> 989 self._aggs[num_hops]([Dropout(self.dropout)(x[i]), neigh_in]) 990 ) 991

~/miniconda3/envs/3.7/lib/python3.7/site-packages/keras/utils/traceback_utils.py in error_handler(*args, **kwargs) 65 except Exception as e: # pylint: disable=broad-except 66 filtered_tb = _process_traceback_frames(e.traceback) ---> 67 raise e.with_traceback(filtered_tb) from None 68 finally: 69 del filtered_tb

~/miniconda3/envs/3.7/lib/python3.7/site-packages/stellargraph/layer/graphsage.py in build(self, input_shape) 192 193 # Calculate weight size for each input group --> 194 self.calculate_group_sizes(input_shape) 195 196 # Configure weights for input groups, if used.

~/miniconda3/envs/3.7/lib/python3.7/site-packages/stellargraph/layer/graphsage.py in calculate_group_sizes(self, input_shape) 145 if num_groups < 1: 146 raise ValueError( --> 147 "There must be at least one input with a non-zero neighbourhood dimension" 148 ) 149

ValueError: There must be at least one input with a non-zero neighbourhood dimension

To Reproduce

mydata StellarGraph: Undirected multigraph Nodes: 6164216, Edges: 43354235

Node types: default: [6164216] Features: none Edge types: default-default->default

Edge types: default-default->default: [43354235] Weights: all 1 (default) Features: none

chi2liu avatar Jul 27 '22 10:07 chi2liu