2

I am trying to import a pretrained tensorflow model (the default sound recognition one in the tutorial) and I keep getting this error.

I tried importing using both a checkpoint file and a .pb file, and as a beginner, I have no idea about this error. Any help would be appreciated!

I have tried this on Debian and Windows 10, python3.5 and python 3.6 with multiple versions of tensorflow.

Traceback (most recent call last):
  File "C:\tmp\speech_commands_train\Ztest.py", line 4, in <module>
    saver = tf.train.import_meta_graph('conv.ckpt-18000.meta')
  File "C:\Dev\Python36\lib\site-packages\tensorflow\python\training\saver.py", line 1927, in import_meta_graph
    **kwargs)
  File "C:\Dev\Python36\lib\site-packages\tensorflow\python\framework\meta_graph.py", line 741, in import_scoped_meta_graph
    producer_op_list=producer_op_list)
  File "C:\Dev\Python36\lib\site-packages\tensorflow\python\util\deprecation.py", line 432, in new_func
    return func(*args, **kwargs)
  File "C:\Dev\Python36\lib\site-packages\tensorflow\python\framework\importer.py", line 457, in import_graph_def
    _RemoveDefaultAttrs(op_dict, producer_op_list, graph_def)
  File "C:\Dev\Python36\lib\site-packages\tensorflow\python\framework\importer.py", line 227, in _RemoveDefaultAttrs
    op_def = op_dict[node.op]
KeyError: 'DecodeWav' 

This is the code that I am using to import:

import tensorflow as tf
sess = tf.Session()
saver = tf.train.import_meta_graph('conv.ckpt-18000.meta')
saver.restore(sess, tf.train.latest_checkpoint('./')) 
utsal
  • 21
  • 2
  • What is your code? What is the tutorial? – Zev Apr 26 '18 at 12:45
  • I have added the code in the question. This is the tutorial that I am using: https://www.tensorflow.org/versions/master/tutorials/audio_recognition – utsal Apr 27 '18 at 15:14
  • I'm having the same error did have you found the cause of the error? – Marco D.G. May 24 '18 at 15:32
  • 2
    @MarcoD.G. yeah. So I installed the normal tensorflow that lacks a line in the build script. So you can either add that and rebuild or just uninstall your current version of tensorflow and install the nightly-build. – utsal May 26 '18 at 05:44

0 Answers0