Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FailedPreconditionError: Attempting to use uninitialized value spectral_net_learning_rate #23

Open
wangemm opened this issue Feb 29, 2020 · 10 comments

Comments

@wangemm
Copy link

wangemm commented Feb 29, 2020

When I tried to run python3 run.py,this error came out.
ERROR:
Traceback (most recent call last):
File "/home/dxchang/miniconda3/envs/vic36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1356, in _do_call
return fn(*args)
File "/home/dxchang/miniconda3/envs/vic36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1341, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/dxchang/miniconda3/envs/vic36/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value spectral_net_learning_rate
[[{{node spectral_net_learning_rate/read}}]]

@CatherineTaelman
Copy link

I have exactly the same problem, please keep me updated if you have found a solution to it.

@lihenryhfl
Copy link
Collaborator

Hi, thanks for using SpecrtalNet, which version of TensorFlow are you using?

@wangemm
Copy link
Author

wangemm commented Mar 4, 2020

Thanks. I run the code on tensorflow1.14.0 and 1.15.0, both get the same error.

@CatherineTaelman
Copy link

For me, the error was resolved by changing the variable initialization in the SpectralNet class (networks.py) to this:
K.get_session().run(tf.initialize_all_variables())

@wangemm
Copy link
Author

wangemm commented Mar 5, 2020

I changed the variable initialization in networks.py:
# K.get_session().run(tf.variables_initializer(self.net.trainable_weights))
K.get_session().run(tf.initialize_all_variables())
It ran, but can`t reproduce paper results.
Results: ACC0.395 NMI0.315

@CatherineTaelman
Copy link

CatherineTaelman commented Mar 11, 2020

@wangemm do you have any update on reproducing the paper results? I have the same issue. I can only achieve the mentioned results when I choose knn affinity and use code space. For the other options I did not succeed in reproducing the results.

@wangemm
Copy link
Author

wangemm commented Mar 24, 2020

@CatherineTaelman I also choose knn affinity and use code space. And get the results:ACC0.395 NMI0.315.

@lihenryhfl
Copy link
Collaborator

This is old, but have you made sure to use keras==2.3 as well? We realized that this was an important choice.

@mertsener057
Copy link

hi, i have same issue im using keras==2.3 and tensorflow version 1.5
K.get_session().run(tf.variables_initializer(self.net.trainable_weights)) making error .
i tried K.get_session().run(tf.initialize_all_variables()) give low acc and nmi. how can i fix?
Thank you.
Can we use global initializer instead do you have any idea?

@DavidLeexxxx
Copy link

Thankyou for the research on SpectralNet and this opensourse code. I have the same question as @mertsener057 and some of the users' above. While I am now have two questions briefly:

  1. Why the environment or the versions of packages contribute so much to the performances of this model?
  2. Is it possible for me to rewrite the code to make it adaptive to the latest versions of tensorflow or the other ML structures used in SpectralNet and get the same performances as your paper presented?
    Waiting for your advice with appreciation and respect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants