<p dir="auto">im trying to run the voice recognition example</p>
<p dir="auto">for some reason specifying a clip_duration_ms diffren from 1000 generate an error while freezing the model.</p>
<p dir="auto">so running<br>
python tensorflow/examples/speech_commands/freeze.py<br>
--wanted_words=yes<br>
--clip_duration_ms=2800 --sample_rate=16000 --window_size_ms=20<br>
--start_checkpoint=/notebooks/yesmodel/conv.ckpt-10<br>
--output_file=/notebooks/yesmodel/conv_frozen.pb</p>
<p dir="auto">generate the following message<br>
Error: Assign requires shapes of both tensors to match. lhs shape= [320000,3] rhs shape= [62720,3]</p>
<p dir="auto">any idea what im doing wrong?</p>
<hr>
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>:No. I am running the Audio recognition tutorial</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Ubuntu 14.04</li>
<li><strong>TensorFlow installed from (source or binary)</strong>:source</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.3.0</li>
<li><strong>Python version</strong>: 3.6</li>
<li><strong>Bazel version (if compiling from source)</strong>:0.6.0</li>
<li><strong>CUDA/cuDNN version</strong>:</li>
<li><strong>GPU model and memory</strong>:</li>
<li><strong>Exact command to reproduce</strong>:python tensorflow/examples/speech_commands/freeze.py <br>
--start_checkpoint=/tmp/speech_commands_train/conv.ckpt-18000 <br>
--output_file=/tmp/my_frozen_graph.pb</li>
</ul>
<p dir="auto">I am asking about the error (attached below) here(rather than on stackoverflow) because of this related issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="188195671" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/5492" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/5492/hovercard" href="https://github.com/tensorflow/tensorflow/issues/5492">#5492</a> . I want to know if my error can be resolved by tweaking the validate_shape parameter,by setting it to false? . If not, please suggest alternatives.</p>
<p dir="auto">The error is as follows:</p>
<p dir="auto">Traceback (most recent call last):<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1321, in _do_call<br>
return fn(*args)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1300, in _run_fn<br>
status, run_metadata)<br>
File "/home/cogknit/anaconda3/lib/python3.6/contextlib.py", line 89, in <strong>exit</strong><br>
next(self.gen)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 467, in raise_exception_on_not_ok_status<br>
c_api.TF_GetCode(status.status))<br>
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [12] rhs shape= [3]<br>
[[Node: save/Assign_5 = Assign[T=DT_FLOAT, _class=["loc:@Variable_5"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/cpu:0"](Variable_5, save/RestoreV2_5)]]</p>
<p dir="auto">During handling of the above exception, another exception occurred:</p>
<p dir="auto">Traceback (most recent call last):<br>
File "tensorflow/examples/speech_commands/freeze.py", line 180, in <br>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run<br>
_sys.exit(main(_sys.argv[:1] + flags_passthrough))<br>
File "tensorflow/examples/speech_commands/freeze.py", line 117, in main<br>
models.load_variables_from_checkpoint(sess, FLAGS.start_checkpoint)<br>
File "/home/cogknit/tensorflow/tensorflow/examples/speech_commands/models.py", line 123, in load_variables_from_checkpoint<br>
saver.restore(sess, start_checkpoint)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1657, in restore<br>
{self.saver_def.filename_tensor_name: save_path})<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 889, in run<br>
run_metadata_ptr)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1118, in _run<br>
feed_dict_tensor, options, run_metadata)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1315, in _do_run<br>
options, run_metadata)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call<br>
raise type(e)(node_def, op, message)<br>
tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [12] rhs shape= [3]<br>
[[Node: save/Assign_5 = Assign[T=DT_FLOAT, _class=["loc:@Variable_5"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/cpu:0"](Variable_5, save/RestoreV2_5)]]</p>
<p dir="auto">Caused by op 'save/Assign_5', defined at:<br>
File "tensorflow/examples/speech_commands/freeze.py", line 180, in <br>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run<br>
_sys.exit(main(_sys.argv[:1] + flags_passthrough))<br>
File "tensorflow/examples/speech_commands/freeze.py", line 117, in main<br>
models.load_variables_from_checkpoint(sess, FLAGS.start_checkpoint)<br>
File "/home/cogknit/tensorflow/tensorflow/examples/speech_commands/models.py", line 122, in load_variables_from_checkpoint<br>
saver = tf.train.Saver(tf.global_variables())<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1214, in <strong>init</strong><br>
self.build()<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1223, in build<br>
self._build(self._filename, build_save=True, build_restore=True)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1259, in _build<br>
build_save=build_save, build_restore=build_restore)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 747, in _build_internal<br>
restore_sequentially, reshape)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 435, in _AddRestoreOps<br>
assign_ops.append(saveable.restore(tensors, shapes))<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 160, in restore<br>
self.op.get_shape().is_fully_defined())<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/state_ops.py", line 276, in assign<br>
validate_shape=validate_shape)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_state_ops.py", line 56, in assign<br>
use_locking=use_locking, name=name)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper<br>
op_def=op_def)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3082, in create_op<br>
op_def=op_def)<br>
File "/home/cogknit/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1632, in <strong>init</strong><br>
self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access</p>
<p dir="auto">InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [12] rhs shape= [3]<br>
[[Node: save/Assign_5 = Assign[T=DT_FLOAT, _class=["loc:@Variable_5"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/cpu:0"](Variable_5, save/RestoreV2_5)]]</p>