SpectralNet icon indicating copy to clipboard operation
SpectralNet copied to clipboard

FailedPreconditionError: Attempting to use uninitialized value spectral_net_learning_rate

Open wangemm opened this issue 4 years ago • 10 comments

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}}]]

wangemm avatar Feb 29 '20 11:02 wangemm

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

CatherineTaelman avatar Mar 03 '20 11:03 CatherineTaelman

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

lihenryhfl avatar Mar 03 '20 15:03 lihenryhfl

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

wangemm avatar Mar 04 '20 02:03 wangemm

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())

CatherineTaelman avatar Mar 04 '20 09:03 CatherineTaelman

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

wangemm avatar Mar 05 '20 08:03 wangemm

@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.

CatherineTaelman avatar Mar 11 '20 08:03 CatherineTaelman

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

wangemm avatar Mar 24 '20 03:03 wangemm

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

lihenryhfl avatar Nov 24 '20 00:11 lihenryhfl

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?

mertsener057 avatar Jan 26 '21 06:01 mertsener057

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!

DavidLeexxxx avatar Apr 06 '21 09:04 DavidLeexxxx