Coder Social home page Coder Social logo

tf2-gnn's Introduction

Graph Neural Networks in TF2

Implementation and example training scripts of various flavours of graph neural network in TensorFlow 2.0. Much of it is based on the code in the tf-gnn-samples repo.

The code is maintained by the AI4Science team at Microsoft Research. We are hiring.

Currently this package is not under active developement, but it does continue to be used as a backend for our generative model of molecules.

Installation

You can install the tf2_gnn module from the Python Package Index using pip install tf2_gnn.

Alternatively (for example, for development), you can check out this repository, navigate to it and run pip install -e ./ to install it as a local editable package.

You will then be able to use the tf2_gnn.layers.GNN class and related utilities.

This code was tested in Python 3.7, 3.8 and 3.9.

Testing the Installation

To test if all components are set up correctly, you can run a simple experiment on the protein-protein interaction (PPI) task first described by Zitnik & Leskovec, 2017. You can download the data for this task from https://data.dgl.ai/dataset/ppi.zip and unzip it into a local directory (e.g., data/ppi). Then, you can use the convenience utility tf2_gnn_train (see --help for a description of options) to train a Relational Graph Convoluational Network model as follows:

$ tf2_gnn_train RGCN PPI --max-epochs 10 data/ppi/
Setting random seed 0.
Trying to load task/model-specific default parameters from /dpuhome/files/users/mabrocks/Projects/TF2-GNN/tf2_gnn/cli_utils/default_hypers/PPI_RGCN.json ... File found.
 Dataset default parameters: {'max_nodes_per_batch': 10000, 'add_self_loop_edges': True, 'tie_fwd_bkwd_edges': False}
Loading data from data/ppi/.
 Loading PPI train data from data/ppi/.
 Loading PPI valid data from data/ppi/.
[...]
Dataset parameters: {"max_nodes_per_batch": 8000, "add_self_loop_edges": true, "tie_fwd_bkwd_edges": false}
Model parameters: {"gnn_aggregation_function": "sum", "gnn_message_activation_function": "ReLU", "gnn_hidden_dim": 320, "gnn_use_target_state_as_input": false, "gnn_normalize_by_num_incoming": true, "gnn_num_edge_MLP_hidden_layers": 0, "gnn_message_calculation_class": "RGCN", "gnn_initial_node_representation_activation": "tanh", "gnn_dense_intermediate_layer_activation": "tanh", "gnn_num_layers": 4, "gnn_dense_every_num_layers": 10000, "gnn_residual_every_num_layers": 10000, "gnn_use_inter_layer_layernorm": false, "gnn_layer_input_dropout_rate": 0.1, "gnn_global_exchange_mode": "gru", "gnn_global_exchange_every_num_layers": 10000, "gnn_global_exchange_weighting_fun": "softmax", "gnn_global_exchange_num_heads": 4, "gnn_global_exchange_dropout_rate": 0.2, "optimizer": "Adam", "learning_rate": 0.001, "learning_rate_decay": 0.98, "momentum": 0.85, "gradient_clip_value": 1.0}
Initial valid metric: Avg MicroF1: 0.368.
   (Stored model metadata to trained_model/RGCN_PPI__2020-02-25_11-10-38_best.pkl and weights to trained_model/RGCN_PPI__2020-02-25_11-10-38_best.hdf5)
== Epoch 1
 Train:  25.6870 loss | Avg MicroF1: 0.401 | 2.63 graphs/s
 Valid:  33.1668 loss | Avg MicroF1: 0.419 | 4.01 graphs/s
  (Best epoch so far, target metric decreased to -0.41886 from -0.36762.)
   (Stored model metadata to trained_model/RGCN_PPI__2020-02-25_11-10-38_best.pkl and weights to trained_model/RGCN_PPI__2020-02-25_11-10-38_best.hdf5)
[...]

After training finished, tf2_gnn_test trained_model/RGCN_PPI__2020-02-25_11-10-38_best.pkl data/ppi can be used to test the trained model.

Code Structure

Layers

The core functionality of the library is implemented as TensorFlow 2 (Keras) layers, enabling easy integration into other code.

tf2_gnn.layers.GNN

This implements a deep Graph Neural Network, stacking several layers of message passing. On construction, a dictionary of hyperparameters needs to be provided (default values can be obtained from GNN.get_default_hyperparameters()). These hyperparameters configure the exact stack of GNN layers:

  • "num_layers" sets the number of GNN message passing layers (usually, a number between 2 and 16)

  • "message_calculation_class" configures the message passing style. This chooses the tf2_gnn.layers.message_passing.* layer used in each step.

    We currently support the following:

    • GGNN: Gated Graph Neural Networks (Li et al., 2015).
    • RGCN: Relational Graph Convolutional Networks (Schlichtkrull et al., 2017).
    • RGAT: Relational Graph Attention Networks (Veličković et al., 2018).
    • RGIN: Relational Graph Isomorphism Networks (Xu et al., 2019).
    • GNN-Edge-MLP: Graph Neural Network with Edge MLPs - a variant of RGCN in which messages on edges are computed using full MLPs, not just a single layer applied to the source state.
    • GNN-FiLM: Graph Neural Networks with Feature-wise Linear Modulation (Brockschmidt, 2019) - a new extension of RGCN with FiLM layers.

    Some of these expose additional hyperparameters; refer to their implementation for details.

  • "hidden_dim" sets the size of the output of all message passing layers.

  • "layer_input_dropout_rate" sets the dropout rate (during training) for the input of each message passing layer.

  • "residual_every_num_layers" sets how often a residual connection is inserted between message passing layers. Concretely, a value of k means that every layer l that is a multiple of k (and only those!) will not receive the outputs of layer l-1 as input, but instead the mean of the outputs of layers l-1 and l-k.

  • "use_inter_layer_layernorm" is a boolean flag indicating if LayerNorm should be used between different message passing layers.

  • "dense_every_num_layers" configures how often a per-node representation dense layer is inserted between the message passing layers. Setting this to a large value (greather than "num_layers") means that no dense layers are inserted at all.

    "dense_intermediate_layer_activation" configures the activation function used after the dense layer; the default of "tanh" can help stabilise training of very deep GNNs.

  • "global_exchange_every_num_layers" configures how often a graph-level exchange of information is performed. For this, a graph level representation (see tf2_gnn.layers.NodesToGraphRepresentation below) is computed and then used to update the representation of each node. The style of this update is configured by "global_exchange_mode", offering three modes:

    • "mean", which just computes the arithmetic mean of the node and graph-level representation.
    • "mlp", which computes a new representation using an MLP that gets the concatenation of node and graph level representations as input.
    • "gru", which uses a GRU cell that gets the old node representation as state and the graph representation as input.

The GNN layer takes a GNNInput named tuple as input, which encapsulates initial node features, adjacency lists, and auxiliary information. The easiest way to construct such a tuple is to use the provided dataset classes in combination with the provided model.

tf2_gnn.layers.NodesToGraphRepresentation

This implements the task of computing a graph-level representation given node-level representations (e.g., obtained by the GNN layer).

Currently, this is only implemented by the WeightedSumGraphRepresentation layer, which produces a graph representation by a multi-headed weighted sum of (transformed) node representations, configured by the following hyperparameters set in the layer constructor:

  • graph_representation_size sets the size of the computed representation. By setting this to 1, this layer can be used to directly implement graph-level regression tasks.
  • num_heads configures the number of parallel (independent) weighted sums that are computed, whose results are concatenated to obtain the final result. Note that this means that the graph_representation_size needs to be a multiple of the num_heads value.
  • weighting_fun can take two values:
    • "sigmoid" computes a weight for each node independently by first computing a per-node score, which is then squashed through a sigmoid. This is appropriate for tasks that are related to counting occurrences of a feature in a graph, where the node weight is used to ignore certain nodes.
    • "softmax" computes weights for all graph nodes together by first computing per-node scores, and then performing a softmax over all scores. This is appropriate for tasks that require identifying important parts of the graph.
  • scoring_mlp_layers, scoring_mlp_activation_fun, scoring_mlp_dropout_rate configure the MLP that computes the per-node scores.
  • transformation_mlp_layers, transformation_mlp_activation_fun, transformation_mlp_dropout_rate configure the MLP that computes the transformed node representations that are summed up.

Datasets

We use a sparse representation of graphs, which requires a complex batching strategy in which the graphs making up a minibatch are joined into a single graph of many disconnected components. The extensible tf2_gnn.data.GraphDataset class implements this procedure, and can be subclassed to handle task-specific datasets and additional properties. It exposes a get_tensorflow_dataset method that can be used to obtain a tf.data.Dataset that can be used in training/evaluation loops.

We currently provide three implementations of this:

  • tf2_gnn.data.PPIDataset implements reading the protein-protein interaction (PPI) data first used by Zitnik & Leskovec, 2017.
  • tf2_gnn.data.QM9Dataset implements reading the quantum chemistry data first used by Ramakrishnan et al., 2014.
  • tf2_gnn.data.JsonLGraphPropertyDataset implements reading a generic dataset made up of graphs with a single property, stored in JSONLines format:
    • Files "train.jsonl.gz", "valid.jsonl.gz" and "test.jsonl.gz" are expected to store the train/valid/test datasets.
    • Each of the files is gzipped text file in which each line is a valid JSON dictionary with
      • a "graph" key, which in turn points to a dictionary with keys
        • "node_features" (list of numerical initial node labels),
        • "adjacency_lists" (list of list of directed edge pairs),
      • a "Property" key having a a single floating point value.

Models

We provide some built-in models in tf2_gnn.models, which can either be directly re-used or serve as inspiration for other models:

  • tf2_gnn.models.GraphRegressionTask implements a graph-level regression model, for example to make molecule-level predictions such as in the QM9 task.
  • tf2_gnn.models.GraphBinaryClassificationTask implements a binary classification model.
  • tf2_gnn.models.NodeMulticlassTask implements a node-level multiclass classification model, suitable to implement the PPI task.

Tasks

Tasks are a combination of datasets, models and specific hyperparameter settings. These can be registered (and then used by name) using the utilities in tf2_gnn.utils.task_utils (where a few default tasks are defined as well) and then used in tools such as tf2_gnn_train.

Authors

References

Brockschmidt, 2019

Marc Brockschmidt. GNN-FiLM: Graph Neural Networks with Feature-wise Linear Modulation. (https://arxiv.org/abs/1906.12192)

Li et al., 2015

Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated Graph Sequence Neural Networks. In International Conference on Learning Representations (ICLR), 2016. (https://arxiv.org/pdf/1511.05493.pdf)

Ramakrishnan et al., 2014

Raghunathan Ramakrishnan, Pavlo O. Dral, Matthias Rupp, and O. Anatole Von Lilienfeld. Quantum Chemistry Structures and Properties of 134 Kilo Molecules. Scientific Data, 1, 2014. (https://www.nature.com/articles/sdata201422/)

Schlichtkrull et al., 2017

Michael Schlichtkrull, Thomas N. Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling Relational Data with Graph Convolutional Networks. In Extended Semantic Web Conference (ESWC), 2018. (https://arxiv.org/pdf/1703.06103.pdf)

Veličković et al. 2018

Petar Veličković, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. Graph Attention Networks. In International Conference on Learning Representations (ICLR), 2018. (https://arxiv.org/pdf/1710.10903.pdf)

Xu et al. 2019

Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How Powerful are Graph Neural Networks? In International Conference on Learning Representations (ICLR), 2019. (https://arxiv.org/pdf/1810.00826.pdf)

Zitnik & Leskovec, 2017

Marinka Zitnik and Jure Leskovec. Predicting Multicellular Function Through Multi-layer Tissue Networks. Bioinformatics, 33, 2017. (https://arxiv.org/abs/1707.04638)

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

tf2-gnn's People

Contributors

kmaziarz avatar megstanley avatar mmjb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tf2-gnn's Issues

export to onnx format?

Hi folks -

I'd like to export this model to the ONNX format. I'm interesting in understanding the operations, data types and tensor dimensioning at each layer.

Is there a set of step you can provide to understand how that can be done? I have all necessary collateral (onnx, tensorflow) installed.

thank you,
Kevin

Loading custom dataset and building the graph in batches

Hello!

I have my own dataset and I want to use this library to train GNNs. My dataset is in TFRecords format and read using tf.data.Dataset as_numpy_iterator(), where 1 batch of iterator represents 1 graph. How can I feed in this data to this library? I want to construct 1 huge train graph (which consists of multiple graphs from the numpy iterator) and 1 huge test graph that follows PPI Dataset format. I guess this implies that the train and test graph object generation will be done in batches. Is that possible? Or if the resulted graph object or matrices are too large, how can I train in minibatches? Thanks

Can RGAT be implemented for a graph level multiclass-classification?

I have written a graph mutli-class classification task, following the lead from the GraphBinaryClassificationTask,
and a dataset file following the lead from json_graph_property_dataset, but how do I use an rgat layer now? The PPI is an implementation of node level task, so I wanted to make sure what I'm trying to do is plausible here.

How to add a RGAT layer to a custom keras model?

I have been struggling for a while trying to do this, but I'm still more or less a noob, so I precise your help.

Here is one of my attemps:

from keras import Model, layers

inputLayer_X = layers.Input(shape=tf.TensorShape(dims=(None, 3)),name="Input_X")
inputLayer_A = layers.Input(shape=tuple(tf.TensorShape(dims=(None, 2)) for _ in range(3)),name="Input_A")
rgatLayer_1 = RGAT({'aggregation_function': 'sum', 'hidden_dim': 10,
                    'message_activation_before_aggregation': False,
                    'message_activation_function': 'relu', 'num_heads': 5}, name="RGAT_1")(MessagePassingInput(inputLayer_X, inputLayer_A))
modelo = Model([inputLayer_X, inputLayer_A], rgatLayer_1, name="The_model")

Which returns:


TypeError Traceback (most recent call last)
in ()
1 inputLayer_X = layers.Input(shape=tf.TensorShape(dims=(None, 3)),name="Input_X")
----> 2 inputLayer_A = layers.Input(shape=tuple(tf.TensorShape(dims=(None, 2)) for _ in range(3)),name="Input_A")
3 rgatLayer_1 = RGAT({'aggregation_function': 'sum', 'hidden_dim': 10,
4 'message_activation_before_aggregation': False,
5 'message_activation_function': 'relu', 'num_heads': 5}, name="RGAT_1")(MessagePassingInput(inputLayer_X, inputLayer_A))

1 frames
/usr/local/lib/python3.7/dist-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

/usr/local/lib/python3.7/dist-packages/six.py in raise_from(value, from_value)

TypeError: Dimension value must be integer or None or have an index method, got value 'TensorShape([None, 2])' with type '<class 'tensorflow.python.framework.tensor_shape.TensorShape'>'

And here's another:

from keras import Model, layers

inputLayer_X = layers.Input(shape=tf.TensorShape(dims=(None, 3)),name="Input_X")
inputLayer_A1 = layers.Input(shape=tf.TensorShape(dims=(None, 2)),name="Input_A1")
inputLayer_A2 = layers.Input(shape=tf.TensorShape(dims=(None, 2)),name="Input_A2")
inputLayer_A3 = layers.Input(shape=tf.TensorShape(dims=(None, 2)),name="Input_A3")
rgatLayer_1 = RGAT({'aggregation_function': 'sum', 'hidden_dim': 10,
                    'message_activation_before_aggregation': False,
                    'message_activation_function': 'relu', 'num_heads': 5}, name="RGAT_1")(MessagePassingInput(inputLayer_X,
                                                                                                               [inputLayer_A1, inputLayer_A2, inputLayer_A3]))
modelo = Model([inputLayer_X, inputLayer_A1, inputLayer_A2, inputLayer_A3], rgatLayer_1, name="The_model")

That yields:


TypeError Traceback (most recent call last)
in ()
6 'message_activation_before_aggregation': False,
7 'message_activation_function': 'relu', 'num_heads': 5}, name="RGAT_1")(MessagePassingInput(inputLayer_X,
----> 8 [inputLayer_A1, inputLayer_A2, inputLayer_A3]))
9 modelo = Model([inputLayer_X, inputLayer_A1, inputLayer_A2, inputLayer_A3], rgatLayer_1, name="The_model")

1 frames
/usr/local/lib/python3.7/dist-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

/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py in wrapper(*args, **kwargs)
697 except Exception as e: # pylint:disable=broad-except
698 if hasattr(e, 'ag_error_metadata'):
--> 699 raise e.ag_error_metadata.to_exception(e)
700 else:
701 raise

TypeError: Exception encountered when calling layer "RGAT_1" (type RGAT).

in user code:

File "/usr/local/lib/python3.7/dist-packages/tf2_gnn/layers/message_passing/message_passing.py", line 116, in call  *
    messages_per_type = self._calculate_messages_per_type(
File "/usr/local/lib/python3.7/dist-packages/tf2_gnn/layers/message_passing/message_passing.py", line 190, in _calculate_messages_per_type  *
    type_to_num_incoming_edges = calculate_type_to_num_incoming_edges(
File "/usr/local/lib/python3.7/dist-packages/tf2_gnn/layers/message_passing/message_passing.py", line 256, in calculate_type_to_num_incoming_edges  *
    num_incoming_edges = tf.scatter_nd(

TypeError: Value passed to parameter 'indices' has DataType float32 not in list of allowed values: int32, int64

Call arguments received:
• inputs=MessagePassingInput(node_embeddings='tf.Tensor(shape=(None, None, 3), dtype=float32)', adjacency_lists=['tf.Tensor(shape=(None, None, 2), dtype=float32)', 'tf.Tensor(shape=(None, None, 2), dtype=float32)', 'tf.Tensor(shape=(None, None, 2), dtype=float32)'])
• training=False

I'll keep trying to overcome it (and will update if I do so), but if someone can throw some light on the matter, I would be very grateful 🙏

Dataset about the model "GraphBinaryClassificationTask"

Hello, I have some questions about your graph classification model:"GraphBinaryClassificationTask":
About dataset case: could you support a data set for me to run a sample about this model, because I still don’t understand what kind of input will not give an error after reading readme. (My data set is that lots of graphs and each has lots of nodes(may be a NM), and multiple types of edges(NN), and each graph has a label.)
I really hope you can support a case of the data set to help me with the data preprocessing work.Thank you very much!

Error: Can't pickle generator

On Windows 10, with Python 3.6.5, getting error on running

tf2_gnn_train RGCN PPI --max-epochs 10 data/ppi/

log is:

2021-06-10 18:44:04.837559: W tensorflow/core/framework/op_kernel.cc:1755] Invalid argument: TypeError: cannot pickle 'generator' object
Traceback (most recent call last):

  File "C:\Users\yogesh.kulkarni\AppData\Local\Continuum\anaconda3\envs\tf2\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 789, in get_iterator
    return self._iterators[iterator_id]

KeyError: 0

Any resolution?

Performance issue in tf2_gnn/layers/message_passing/message_passing.py

Hello,
I found that in the function calculate_type_to_num_incoming_edges, tf2_gnn/layers/message_passing/message_passing.py, tf.shapewill be called redundantly in the iteration to get the same value, code here.
Moreover, if users try to add @tf.funtion annotation to speed up this function in graph mode, lots of same nodes will be created in computation graph.
Thus, I think tf.shape should be called only once before the loop.

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

TF2-GNN and MLFlow

Hi all,

thanks for the great work on tf2-gnn.

I have an issue with using MLFlow (which uses azure-storage-blob>=12.0) in combination with tf2-gnn (which requires "dpu-utils>=0.2.7").

When I import both modules, depending on the installation order, I either get in mlflow:

from azure.storage.blob import BlockBlobService
ImportError: cannot import name 'BlockBlobService'

or also in tf2_gnn (in the dpu_utils package and in tf2-gnn in /tf2_gnn/data/graph_dataset.py, line 7.):

from azure.storage.blob import BlobClient
ImportError: cannot import name 'BlobClient'

I followed the ideas here: https://stackoverflow.com/questions/50581138/cannot-import-name-blockblobservice
but none of them worked unfortunately.

Do you have any ideas on this? Thanks 👍

Encode-decoder on Geometric Graph Data?

I am working on a dimension reduction problem on shapes, where,

  • shapes are represented as graph,
  • vertices as nodes,
  • connecting curves as edges.
  • dimension reduction operation is called as Midcurve generation.
  • Input is 2D profile, say a closed polygon.
  • Output is 1D curve in the middle of the profile

image

More info:

image

ToDos:

  • Write a dataloader for geometric shape data, nodes will get coordinates as features and edges will get sample points coordinates
  • Construct Encoder Decoder, similar to Semantic Segmentation on images, but now, using Graph Convolutional Layers on geometric data.

Is this possible/feasible currently with tf-gnn?

Performance issu in the definition of calculate_type_to_num_incoming_edges, tf2_gnn/layers/message_passing/message_passing.py(P1))

Hello, I found a performance issue in the definition of calculate_type_to_num_incoming_edges, tf2_gnn/layers/message_passing/message_passing.py, tf.shape(node_embeddings)[0] will be calculated repeatedly during the program execution, resulting in reduced efficiency. I think it should be created before the loop.

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

Error when attempting to run test installation script: tf2_gnn_train RGCN PPI --max-epochs 10 data/ppi/

Seems to be related to the latest: merge pull request #38 from microsoft/mstan/expose-tffunc-disable

If you comment out the disable_tf_function_build argument in line 225 of model_utils.py, the code will run but then I hit issue #31

Error output is below:

E:\venv\Scripts\python.exe E:/venv/Scripts/tf2_gnn_train-script.py RGCN PPI --max-epochs 10 e:/data/ppi/
2021-01-24 15:07:15.212314: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
Setting random seed 0.
Trying to load task/model-specific default parameters from E:\repos\tf2-gnn\tf2_gnn\cli_utils\default_hypers\PPI_RGCN.json ... File found.
Dataset default parameters: {'max_nodes_per_batch': 10000, 'add_self_loop_edges': True, 'tie_fwd_bkwd_edges': False}
Loading data from e:/data/ppi/.
Loading PPI train data from e:/data/ppi/.
Loading PPI valid data from e:/data/ppi/.
Traceback (most recent call last):
Model default parameters: {'gnn_aggregation_function': 'sum', 'gnn_message_activation_function': 'relu', 'gnn_message_activation_before_aggregation': False, 'gnn_hidden_dim': 16, 'gnn_use_target_state_as_input': False, 'gnn_normalize_by_num_incoming': True, 'gnn_num_edge_MLP_hidden_layers': 0, 'gnn_message_calculation_class': 'RGCN', 'gnn_initial_node_representation_activation': 'tanh', 'gnn_dense_intermediate_layer_activation': 'tanh', 'gnn_num_layers': 4, 'gnn_dense_every_num_layers': 2, 'gnn_residual_every_num_layers': 2, 'gnn_use_inter_layer_layernorm': False, 'gnn_layer_input_dropout_rate': 0.0, 'gnn_global_exchange_mode': 'gru', 'gnn_global_exchange_every_num_layers': 2, 'gnn_global_exchange_weighting_fun': 'softmax', 'gnn_global_exchange_num_heads': 4, 'gnn_global_exchange_dropout_rate': 0.2, 'optimizer': 'Adam', 'learning_rate': 0.001, 'learning_rate_warmup_steps': None, 'learning_rate_decay_steps': None, 'momentum': 0.85, 'rmsprop_rho': 0.98, 'gradient_clip_value': None, 'gradient_clip_norm': None, 'gradient_clip_global_norm': None, 'use_intermediate_gnn_results': False}
File "E:/venv/Scripts/tf2_gnn_train-script.py", line 33, in
sys.exit(load_entry_point('tf2-gnn', 'console_scripts', 'tf2_gnn_train')())
File "E:\repos\tf2-gnn\tf2_gnn\cli\train.py", line 33, in run
Model parameters overridden by task/model defaults: {'gnn_num_layers': 4, 'gnn_hidden_dim': 320, 'gnn_use_target_state_as_input': False, 'gnn_normalize_by_num_incoming': True, 'gnn_num_edge_MLP_hidden_layers': 0, 'gnn_layer_input_dropout_rate': 0.1, 'gnn_dense_every_num_layers': 10000, 'gnn_residual_every_num_layers': 10000, 'gnn_global_exchange_every_num_layers': 10000, 'gnn_use_inter_layer_layernorm': False, 'gnn_initial_node_representation_activation': 'tanh', 'gnn_dense_intermediate_layer_activation': 'tanh', 'gnn_message_activation_function': 'ReLU', 'gnn_aggregation_function': 'sum'}
lambda: run_train_from_args(args, hyperdrive_hyperparameter_overrides), args.debug
File "E:\venv\lib\site-packages\dpu_utils\utils\debughelper.py", line 21, in run_and_debug
func()
File "E:\repos\tf2-gnn\tf2_gnn\cli\train.py", line 33, in
lambda: run_train_from_args(args, hyperdrive_hyperparameter_overrides), args.debug
File "E:\repos\tf2-gnn\tf2_gnn\cli_utils\training_utils.py", line 165, in run_train_from_args
disable_tf_function_build=args.disable_tf_func,
File "E:\repos\tf2-gnn\tf2_gnn\cli_utils\model_utils.py", line 310, in get_model_and_dataset
disable_tf_function_build=disable_tf_function_build,
File "E:\repos\tf2-gnn\tf2_gnn\cli_utils\model_utils.py", line 225, in get_model
model_params, dataset=dataset, disable_tf_function_build=disable_tf_function_build
TypeError: init() got an unexpected keyword argument 'disable_tf_function_build'

Process finished with exit code 1

Working with Edge Features

Hello,

as far as I understand it the library allows to distuingish between differen edge types but cannot incorporate continuous edge features. But especially when working with molecules, adding bond information to the network adds a lot of value.

So far in tf2-gnn, a message passing layer recieves the information about node_features and adjacency_lists.
If I want to extend the library I would have to additionally pass the edge_features to the respective layers. Additionally, the separate treatment of edge types would be obsolete, as they could simply be encoded in the feature vectors.

Now one workaround would be to include the edge features of all neighboring edges to the node features of a specific node.
I tried this and the results were not much different from simply using plain node features.
Concretely, I want to implement this paper, through which I hope to improve my results.

Long story short, do you plan to extend the library for edge features in the future, as I assume that this will lead to a lot of architectural changes.

Thanks

PYTHON=3.7, TENSORFLOW=2.1.0, AttributeError: Can't pickle local object 'DoubleBufferedIterator.__init__.<locals>.<lambda>'

Hello, I've been try to run the test script with the following package version. I keep getting an error related to pickling (multiprocessing?)
PYTHON=3.7, TENSORFLOW=2.1.0

FULL ERROR MESSAGE:

(ggn) C:\Users\rohan\gated-graph-network>tf2_gnn_train RGCN PPI ppi/
2020-10-04 17:41:57.115816: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
Setting random seed 0.
Trying to load task/model-specific default parameters from c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\cli_utils\default_hypers\PPI_RGCN.json ... File found.
Dataset default parameters: {'max_nodes_per_batch': 10000, 'add_self_loop_edges': True, 'tie_fwd_bkwd_edges': False}
Loading data from ppi/.
Loading PPI train data from ppi/.
Loading PPI valid data from ppi/.
Model default parameters: {'gnn_aggregation_function': 'sum', 'gnn_message_activation_function': 'relu', 'gnn_message_activation_before_aggregation': False, 'gnn_hidden_dim': 16, 'gnn_use_target_state_as_input': False, 'gnn_normalize_by_num_incoming': True, 'gnn_num_edge_MLP_hidden_layers': 0, 'gnn_message_calculation_class': 'RGCN', 'gnn_initial_node_representation_activation': 'tanh', 'gnn_dense_intermediate_layer_activation': 'tanh', 'gnn_num_layers': 4, 'gnn_dense_every_num_layers': 2, 'gnn_residual_every_num_layers': 2, 'gnn_use_inter_layer_layernorm': False, 'gnn_layer_input_dropout_rate': 0.0, 'gnn_global_exchange_mode': 'gru', 'gnn_global_exchange_every_num_layers': 2, 'gnn_global_exchange_weighting_fun': 'softmax', 'gnn_global_exchange_num_heads': 4, 'gnn_global_exchange_dropout_rate': 0.2, 'optimizer': 'Adam', 'learning_rate': 0.001, 'learning_rate_warmup_steps': None, 'learning_rate_decay_steps': None, 'momentum': 0.85, 'rmsprop_rho': 0.98, 'gradient_clip_value': None, 'gradient_clip_norm': None, 'gradient_clip_global_norm': None, 'use_intermediate_gnn_results': False}
Model parameters overridden by task/model defaults: {'gnn_num_layers': 4, 'gnn_hidden_dim': 320, 'gnn_use_target_state_as_input': False, 'gnn_normalize_by_num_incoming': True, 'gnn_num_edge_MLP_hidden_layers': 0, 'gnn_layer_input_dropout_rate': 0.1, 'gnn_dense_every_num_layers': 10000, 'gnn_residual_every_num_layers': 10000, 'gnn_global_exchange_every_num_layers': 10000, 'gnn_use_inter_layer_layernorm': False, 'gnn_initial_node_representation_activation': 'tanh', 'gnn_dense_intermediate_layer_activation': 'tanh', 'gnn_message_activation_function': 'ReLU', 'gnn_aggregation_function': 'sum'}
2020-10-04 17:42:14.657442: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-10-04 17:42:14.683044: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce RTX 2080 Ti computeCapability: 7.5
coreClock: 1.545GHz coreCount: 68 deviceMemorySize: 11.00GiB deviceMemoryBandwidth: 573.69GiB/s
2020-10-04 17:42:14.683431: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-10-04 17:42:14.686151: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-10-04 17:42:14.688197: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-10-04 17:42:14.689052: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-10-04 17:42:14.691229: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-10-04 17:42:14.693451: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-10-04 17:42:14.698189: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-10-04 17:42:14.698417: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1697] Adding visible gpu devices: 0
2020-10-04 17:42:14.698869: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-10-04 17:42:14.699306: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1555] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce RTX 2080 Ti computeCapability: 7.5
coreClock: 1.545GHz coreCount: 68 deviceMemorySize: 11.00GiB deviceMemoryBandwidth: 573.69GiB/s
2020-10-04 17:42:14.699454: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
2020-10-04 17:42:14.699704: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_10.dll
2020-10-04 17:42:14.700079: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_10.dll
2020-10-04 17:42:14.700351: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_10.dll
2020-10-04 17:42:14.700609: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_10.dll
2020-10-04 17:42:14.700921: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_10.dll
2020-10-04 17:42:14.701170: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-10-04 17:42:14.701426: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1697] Adding visible gpu devices: 0
2020-10-04 17:42:15.235636: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1096] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-10-04 17:42:15.235744: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1102] 0
2020-10-04 17:42:15.236221: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] 0: N
2020-10-04 17:42:15.236648: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1241] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 9528 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2080 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5)
Dataset parameters: {"max_nodes_per_batch": 8000, "add_self_loop_edges": true, "tie_fwd_bkwd_edges": false}
Model parameters: {"gnn_aggregation_function": "sum", "gnn_message_activation_function": "ReLU", "gnn_message_activation_before_aggregation": false, "gnn_hidden_dim": 320, "gnn_use_target_state_as_input": false, "gnn_normalize_by_num_incoming": true, "gnn_num_edge_MLP_hidden_layers": 0, "gnn_message_calculation_class": "RGCN", "gnn_initial_node_representation_activation": "tanh", "gnn_dense_intermediate_layer_activation": "tanh", "gnn_num_layers": 4, "gnn_dense_every_num_layers": 10000, "gnn_residual_every_num_layers": 10000, "gnn_use_inter_layer_layernorm": false, "gnn_layer_input_dropout_rate": 0.1, "gnn_global_exchange_mode": "gru", "gnn_global_exchange_every_num_layers": 10000, "gnn_global_exchange_weighting_fun": "softmax", "gnn_global_exchange_num_heads": 4, "gnn_global_exchange_dropout_rate": 0.2, "optimizer": "Adam", "learning_rate": 0.001, "learning_rate_warmup_steps": null, "learning_rate_decay_steps": null, "momentum": 0.85, "rmsprop_rho": 0.98, "gradient_clip_value": null, "gradient_clip_norm": null, "gradient_clip_global_norm": null, "use_intermediate_gnn_results": false}
2020-10-04 17:42:15.852147: W tensorflow/core/framework/op_kernel.cc:1643] Unknown: AttributeError: Can't pickle local object 'DoubleBufferedIterator.init..'
Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 673, in get_iterator
return self._iterators[iterator_id]

KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 236, in call
ret = func(*args)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 789, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 675, in get_iterator
iterator = iter(self._generator(*self._args.pop(iterator_id)))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\data\graph_dataset.py", line 284, in
self.graph_batch_iterator(data_fold)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\dpu_utils\utils\iterators.py", line 149, in init
self.__worker_process_inner.start()

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)

AttributeError: Can't pickle local object 'DoubleBufferedIterator.init..'

2020-10-04 17:42:15.852822: W tensorflow/core/framework/op_kernel.cc:1655] OP_REQUIRES failed at iterator_ops.cc:941 : Unknown: AttributeError: Can't pickle local object 'DoubleBufferedIterator.init..'
Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 673, in get_iterator
return self._iterators[iterator_id]

KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 236, in call
ret = func(*args)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 789, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 675, in get_iterator
iterator = iter(self._generator(*self._args.pop(iterator_id)))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\data\graph_dataset.py", line 284, in
self.graph_batch_iterator(data_fold)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\dpu_utils\utils\iterators.py", line 149, in init
self.__worker_process_inner.start()

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)

AttributeError: Can't pickle local object 'DoubleBufferedIterator.init..'

     [[{{node PyFunc}}]]

2020-10-04 17:42:15.853081: W tensorflow/core/framework/op_kernel.cc:1643] Unknown: KeyError: 0
Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 673, in get_iterator
return self._iterators[iterator_id]

KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 236, in call
ret = func(*args)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 789, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 675, in get_iterator
iterator = iter(self._generator(*self._args.pop(iterator_id)))

KeyError: 0

Traceback (most recent call last):
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\eager\context.py", line 1897, in execution_mode
2020-10-04 17:42:15.855495: W tensorflow/core/framework/op_kernel.cc:1643] Unknown: KeyError: 0
Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 673, in get_iterator
return self._iterators[iterator_id]

KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 236, in call
ret = func(*args)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 789, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 675, in get_iterator
iterator = iter(self._generator(*self._args.pop(iterator_id)))

KeyError: 0

yield

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\iterator_ops.py", line 659, in _next_internal
2020-10-04 17:42:15.856780: W tensorflow/core/framework/op_kernel.cc:1643] Unknown: KeyError: 0
Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 673, in get_iterator
return self._iterators[iterator_id]

KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 236, in call
ret = func(*args)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 789, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 675, in get_iterator
iterator = iter(self._generator(*self._args.pop(iterator_id)))

KeyError: 0

output_shapes=self._flat_output_shapes)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\ops\gen_dataset_ops.py", line 2479, in iterator_get_next_sync
_ops.raise_from_not_ok_status(e, name)
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\framework\ops.py", line 6606, in raise_from_not_ok_status
six.raise_from(core._status_to_exception(e.code, message), None)
File "", line 3, in raise_from
tensorflow.python.framework.errors_impl.UnknownError: AttributeError: Can't pickle local object 'DoubleBufferedIterator.init..'
Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 673, in get_iterator
return self._iterators[iterator_id]

KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 236, in call
ret = func(*args)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 789, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 675, in get_iterator
iterator = iter(self._generator(*self._args.pop(iterator_id)))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\data\graph_dataset.py", line 284, in
self.graph_batch_iterator(data_fold)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\dpu_utils\utils\iterators.py", line 149, in init
self.__worker_process_inner.start()

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)

AttributeError: Can't pickle local object 'DoubleBufferedIterator.init..'

     [[{{node PyFunc}}]] [Op:IteratorGetNextSync]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\rohan\anaconda3\envs\ggn\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\rohan\anaconda3\envs\ggn\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\rohan\Anaconda3\envs\ggn\Scripts\tf2_gnn_train.exe_main
.py", line 7, in
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\cli\train.py", line 33, in run
lambda: run_train_from_args(args, hyperdrive_hyperparameter_overrides), args.debug
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\dpu_utils\utils\debughelper.py", line 21, in run_and_debug
func()
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\cli\train.py", line 33, in
lambda: run_train_from_args(args, hyperdrive_hyperparameter_overrides), args.debug
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\cli_utils\training_utils.py", line 153, in run_train_from_args
aml_run=aml_run,
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\cli_utils\training_utils.py", line 50, in train
_, _, initial_valid_results = model.run_one_epoch(valid_data, training=False, quiet=quiet)
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\models\graph_task_model.py", line 366, in run_one_epoch
for step, (batch_features, batch_labels) in enumerate(dataset):
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\iterator_ops.py", line 630, in next
return self.next()
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\iterator_ops.py", line 674, in next
return self._next_internal()
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\iterator_ops.py", line 665, in _next_internal
return structure.from_compatible_tensor_list(self._element_spec, ret)
File "c:\users\rohan\anaconda3\envs\ggn\lib\contextlib.py", line 130, in exit
self.gen.throw(type, value, traceback)
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\eager\context.py", line 1900, in execution_mode
executor_new.wait()
File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\eager\executor.py", line 67, in wait
pywrap_tensorflow.TFE_ExecutorWaitForAllPendingNodes(self._handle)
tensorflow.python.framework.errors_impl.UnknownError: AttributeError: Can't pickle local object 'DoubleBufferedIterator.init..'
Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 673, in get_iterator
return self._iterators[iterator_id]

KeyError: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\ops\script_ops.py", line 236, in call
ret = func(*args)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 789, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tensorflow_core\python\data\ops\dataset_ops.py", line 675, in get_iterator
iterator = iter(self._generator(*self._args.pop(iterator_id)))

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\tf2_gnn\data\graph_dataset.py", line 284, in
self.graph_batch_iterator(data_fold)

File "c:\users\rohan\anaconda3\envs\ggn\lib\site-packages\dpu_utils\utils\iterators.py", line 149, in init
self.__worker_process_inner.start()

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)

File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)

AttributeError: Can't pickle local object 'DoubleBufferedIterator.init..'

     [[{{node PyFunc}}]]

Traceback (most recent call last):
File "", line 1, in
File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "c:\users\rohan\anaconda3\envs\ggn\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
2020-10-04 17:42:15.906046: W tensorflow/core/kernels/data/generator_dataset_op.cc:103] Error occurred when finalizing GeneratorDataset iterator: Cancelled: Operation was cancelled

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.