Я выполнил квантование с помощью tensorflow, следуя этому руководству: https://www.tensorflow.org/versions/master/how_tos/quantization/index.html
Но когда я загружаю свой квантованный график и делаю что-то вроде:
with tf.Session() as session:
tf.initialize_all_variables().run()
Я получаю сообщение об ошибке:
---------------------------------------------------------------------------
NotFoundError Traceback (most recent call last)
<ipython-input-55-b0945a14b01e> in <module>()
5 all_steps = 0
6 with tf.Session() as session:
----> 7 tf.initialize_all_variables().run()
/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.pyc in run(self, feed_dict, session)
1549 none, the default session will be used.
1550 """
-> 1551 _run_using_default_session(self, feed_dict, self.graph, session)
1552
1553
/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.pyc in _run_using_default_session(operation, feed_dict, graph, session)
3531 "the operation's graph is different from the session's "
3532 "graph.")
-> 3533 session.run(operation, feed_dict)
3534
3535
/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata)
370 try:
371 result = self._run(None, fetches, feed_dict, options_ptr,
--> 372 run_metadata_ptr)
373 if run_metadata:
374 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata)
634 try:
635 results = self._do_run(handle, target_list, unique_fetches,
--> 636 feed_dict_string, options, run_metadata)
637 finally:
638 # The movers are no longer used. Delete them.
/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
706 if handle is None:
707 return self._do_call(_run_fn, self._session, feed_dict, fetch_list,
--> 708 target_list, options, run_metadata)
709 else:
710 return self._do_call(_prun_fn, self._session, handle, feed_dict,
/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in _do_call(self, fn, *args)
726 except KeyError:
727 pass
--> 728 raise type(e)(node_def, op, message)
729
730 def _extend_graph(self):
NotFoundError: Op type not registered 'Dequantize'
Как мне это исправить? Возможно это связано с: https://www.tensorflow.org/versions/r0.9/how_tos/adding_an_op/index.html
но я новичок в тензорном потоке и не так просто понять что мне нужно
dequantize_op_test
с помощью:bazel-bin/tensorflow/contrib/quantization/tools/quantize_graph_test
, он пишет мне все в порядке, но я все еще не могу запустить свой график. И оригинальный график работает хорошо. - person Artem Grachev   schedule 27.07.2016sudo bazel-bin/tensorflow/examples/label_image/label_image --image=<some-path>/p-0001.jpg --input_width=299 --input_height=299 --graph=/tmp/quantized_graph.pb
, я получаю на самом деле ту же ошибку:E tensorflow/examples/label_image/main.cc:278] Not found: Op type not registered 'Dequantize'
- person Artem Grachev   schedule 27.07.2016