Closed tribustale closed 3 years ago
I think you copied the code from the current master version (which has not yet been released in pypi), which contains some additional features not available in the latest released in pypi, which is probably the one you have installed. Specifically, the edge_model_kwargs
global_model_kwargs
, attributes.
If you don't need those arguments you may just do:
class RelationNetwork2(_base.AbstractModule):
def __init__(self,
edge_model_fn,
global_model_fn,
reducer=tf.math.unsorted_segment_sum,
name="relation_network"):
super(RelationNetwork2, self).__init__(name=name)
with self._enter_variable_scope():
self._edge_block = blocks.EdgeBlock(
edge_model_fn=edge_model_fn,
use_edges=False,
use_receiver_nodes=True,
use_sender_nodes=True,
use_globals=False)
self._global_block = blocks.GlobalBlock(
global_model_fn=global_model_fn,
use_edges=True,
use_nodes=False,
use_globals=False,
edges_reducer=reducer)
def _build(self,
graph,
edge_model_kwargs=None,
global_model_kwargs=None):
output_graph = self._global_block(self._edge_block(graph))
return graph.replace(globals=output_graph.globals)
If you need the arguments, you may want to install the library from the github repo directly:
pip install git+git://github.com/deepmind/graph_nets.git
Hope this helps!
Thank you very much for the fast and correct answer! Everything working fine now!
Hi, really interesting library! I am trying to modify one of your modules, modules.RelationNetwork in particular.
Therefore, after importing all the necessary, I copy the definition of "class RelationNetwork" into my notebook:
I initiate the class:
I then pass the
input_graphs
to the model and try to build it:but it returns the follwing error:
Can you help me solve this?
Thanks