google-deepmind / graph_nets

Build Graph Nets in Tensorflow
https://arxiv.org/abs/1806.01261
Apache License 2.0
5.34k stars 783 forks source link

NameError: name 'get_graphs' is not defined #88

Closed MohammadHeydari closed 4 years ago

MohammadHeydari commented 4 years ago

Well, I already installed and import the libraries:

import graph_nets as gn
import sonnet as snt

and these warnings showed up:

WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\sonnet\python\modules\util.py:63: The name tf.GraphKeys is deprecated. Please use tf.compat.v1.GraphKeys instead.

WARNING:tensorflow:
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:
  * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md
  * https://github.com/tensorflow/addons
  * https://github.com/tensorflow/io (for I/O related ops)
If you depend on functionality not listed there, please file an issue.

WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\graph_nets\blocks.py:474: The name tf.unsorted_segment_sum is deprecated. Please use tf.math.unsorted_segment_sum instead.

after running the

# Provide your own functions to generate graph-structured data.
input_graphs = get_graphs()

# Create the graph network.
graph_net_module = gn.modules.GraphNetwork(
    edge_model_fn=lambda: snt.nets.MLP([32, 32]),
    node_model_fn=lambda: snt.nets.MLP([32, 32]),
    global_model_fn=lambda: snt.nets.MLP([32, 32]))

# Pass the input graphs to the graph network, and return the output graphs.
output_graphs = graph_net_module(input_graphs)

this error showed up: NameError: name 'get_graphs' is not defined

alvarosg commented 4 years ago

See my reply here