llSourcell / tensorflow_speech_recognition_demo

This is the code for 'How to Make a Simple Tensorflow Speech Recognizer' by @Sirajology on Youtube
383 stars 250 forks source link

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

Open sandyuzhu1982 opened 6 years ago

sandyuzhu1982 commented 6 years ago

/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 commented 6 years ago

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

mohsin671 commented 6 years ago

I am stuck with this too :(

fulgari commented 6 years ago

Same here, need help for this issue!!!

dsairam17 commented 6 years ago

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 commented 6 years ago

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

T-K-233 commented 6 years ago

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 commented 6 years ago

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!