google-deepmind / graph_nets

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

module 'tensorflow' has no attribute 'GraphKeys' #99

Closed sonofaeolus closed 4 years ago

sonofaeolus commented 4 years ago

import sonnet Traceback (most recent call last): File "", line 1, in File "/home/work/.pyenv/versions/tf20/lib/python3.5/site-packages/sonnet/init.py", line 67, in from sonnet.python import custom_getters File "/home/work/.pyenv/versions/tf20/lib/python3.5/site-packages/sonnet/python/custom_getters/init.py", line 26, in from sonnet.python.custom_getters.restore_initializer import restore_initializer File "/home/work/.pyenv/versions/tf20/lib/python3.5/site-packages/sonnet/python/custom_getters/restore_initializer.py", line 27, in collection=tf.GraphKeys.GLOBAL_VARIABLES): AttributeError: module 'tensorflow' has no attribute 'GraphKeys' module 'tensorflow' has no attribute 'GraphKeys' import error, my tensorflow version is 2.0.0b0 and my tensorlayer version is 2.1.0 how can i fix it?

vbapst commented 4 years ago

I believe that this is due to your sonnet version being sonnet v1 while you are using tensorflow 2 (https://github.com/deepmind/sonnet). Note that our library is not yet compatible with tensorflow 2 (but will soon be).

sonofaeolus commented 4 years ago

another question which graph-nets version compatible with tensorflow 1.14

sonofaeolus commented 4 years ago

I believe that this is due to your sonnet version being sonnet v1 while you are using tensorflow 2 (https://github.com/deepmind/sonnet). Note that our library is not yet compatible with tensorflow 2 (but will soon be).

thanks

alvarosg commented 4 years ago

Version 1.0.4 of the GraphNets library should be compatible with tensorflow 1.14 .

sonofaeolus commented 4 years ago

Version 1.0.4 of the GraphNets library should be compatible with tensorflow 1.14 .

version 1.0,3 is compatible with tensorflow 1.14. thanks