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('./'))