tensorflow量化称pb文件后,win系统运行报错问题

 tensorflow 1.14.0  把vgg模型量化成int8后,在win系统跑,报错如下

Evaluating......
Traceback (most recent call last):
  File "C:\Users\user\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\client\session.py", line 1365, in _do_call
    return fn(*args)
  File "C:\Users\user\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\client\session.py", line 1348, in _run_fn
    self._extend_graph()
  File "C:\Users\user\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\client\session.py", line 1388, in _extend_graph
    tf_session.ExtendSession(self._session)
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'Dequantize' used by {{node conv1_1/weights}}with these attrs: [mode="MIN_FIRST", T=DT_QUINT8]
Registered devices: [CPU, GPU]
Registered kernels:
  <no registered kernels>

	 [[conv1_1/weights]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:/practice_work/001 cut_weight_cnn-master/own/model/other_vgg/04 app_pb.py", line 166, in <module>
    t2 = run2(path='02/erinesim_train_int8.pb', outnode='fc8/Relu:0')
  File "F:/practice_work/001 cut_weight_cnn-master/own/model/other_vgg/04 app_pb.py", line 96, in run2
    true_y: label})
  File "C:\Users\user\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\client\session.py", line 956, in run
    run_metadata_ptr)
  File "C:\Users\user\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\client\session.py", line 1180, in _run
    feed_dict_tensor, options, run_metadata)
  File "C:\Users\user\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\client\session.py", line 1359, in _do_run
    run_metadata)
  File "C:\Users\user\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\client\session.py", line 1384, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op 'Dequantize' used by node conv1_1/weights (defined at C:\Users\Cheng\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\framework\ops.py:1748) with these attrs: [mode="MIN_FIRST", T=DT_QUINT8]
Registered devices: [CPU, GPU]
Registered kernels:
  <no registered kernels>

	 [[conv1_1/weights]]

Process finished with exit code 1

找了很久没有结果,把初始化图放到上面去也不行。后来怀疑是tf版本问题,我在虚拟机上跑了一些,成功了。发现是系统问题。

...
0.06942343711853027
0.07129406929016113
0.06992411613464355
0.0805821418762207
0.07245016098022461
0.07958149909973145
0.07213234901428223
0.07666468620300293
0.08054351806640625
0.07882404327392578
Total testing samples: 20
Total correct predictions: 0
Average accuracy: 0.00%
0.11858132011012028

Process finished with exit code 0

 

©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页