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

ValueError: At least two variables have the same name: FullyConnected/W #30

Open
sandyuzhu1982 opened this issue Feb 23, 2018 · 7 comments

Comments

@sandyuzhu1982
Copy link

/home/mg/anaconda2/envs/tensorflow/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Looking for data spoken_numbers_pcm.tar in data/
Extracting data/spoken_numbers_pcm.tar to data/
Data ready!
loaded batch of 2402 files
WARNING:tensorflow:VARIABLES collection name is deprecated, please use GLOBAL_VARIABLES instead; VARIABLES will be removed after 2017-03-02.
2018-01-31 12:07:20.026732: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2
Traceback (most recent call last):
File "demo.py", line 32, in
model = tflearn.DNN(net, tensorboard_verbose=0)
File "/home/mg/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tflearn/models/dnn.py", line 65, in init
best_val_accuracy=best_val_accuracy)
File "/home/mg/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tflearn/helpers/trainer.py", line 137, in init
allow_empty=True)
File "/home/mg/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1239, in init
self.build()
File "/home/mg/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1248, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/home/mg/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 1284, in _build
build_save=build_save, build_restore=build_restore)
File "/home/mg/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 743, in _build_internal
saveables = self._ValidateAndSliceInputs(names_to_saveables)
File "/home/mg/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 596, in _ValidateAndSliceInputs
names_to_saveables = BaseSaverBuilder.OpListToDict(names_to_saveables)
File "/home/mg/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/training/saver.py", line 561, in OpListToDict
name)
ValueError: At least two variables have the same name: FullyConnected/W

@DhanushDK17
Copy link

Did you find any solution to this, I've the same problem....

@mohsin671
Copy link

I am stuck with this too :(

@fulgari
Copy link

fulgari commented Mar 24, 2018

Same here, need help for this issue!!!

@dsairam17
Copy link

I fixed this error by installing tensorflow v1.2 instead of v1.6.

So, first uninstall the currently installed tensorflow using the command pip3 uninstall tensorflow .

Then, install tensorflow v1.2 using the command pip3 install tensorflow==1.2.0

@slxiao
Copy link

slxiao commented Apr 1, 2018

I used tensorflow docker image and met the same problem. Do we have other solution instead of downgrading to v1.2?

@T-K-233
Copy link

T-K-233 commented Apr 19, 2018

You can try to delete this part:

### add this "fix" for tensorflow version errors
col = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES)
for x in col:
    tf.add_to_collection(tf.GraphKeys.VARIABLES, x )

It works fine for me :D

@esevre
Copy link

esevre commented Apr 24, 2018

Thanks T-K-233, deleting those lines helped me to run the example. I was frustrated, because I don't want to go back to old versions of Tensorflow to learn, and you helped me to get it going!

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

8 participants