profile
viewpoint

Ask questionsRolled RNN cannot be converted to INT8

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04.4 LTS
  • TensorFlow installed from (source or binary): tf-nightly
  • TensorFlow version (use command below): 2.2.0.dev20200508 (also happens with 2.3.0.dev20200605)
  • Python version: 3.7.4

Describe the current behavior When converting a rolled RNN model to INT8, the conversion fails with the following error:

TypeError: pybind11::init(): factory function returned nullptr
During handling of the above exception, another exception occurred:
...
ValueError: Failed to parse the model: pybind11::init(): factory function returned nullptr.

Describe the expected behavior The conversion should be successful.

Standalone code to reproduce the issue Please find the gist here

Other info / logs Include any logs or source code that would be helpful to My traceback:

Traceback (most recent call last):
  File "/opt/anaconda/3/envs/P3.7.4_TF2.2.0.dev20200508/lib/python3.7/site-packages/tensorflow/lite/python/optimize/calibrator.py", line 51, in __init__
    _calibration_wrapper.CalibrationWrapper(model_content))
TypeError: pybind11::init(): factory function returned nullptr

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "rnn_rolled_issue.py", line 83, in <module>
    tflite_model_INT8 = converter.convert()
  File "/opt/anaconda/3/envs/P3.7.4_TF2.2.0.dev20200508/lib/python3.7/site-packages/tensorflow/lite/python/lite.py", line 639, in convert
    output_tensors)
  File "/opt/anaconda/3/envs/P3.7.4_TF2.2.0.dev20200508/lib/python3.7/site-packages/tensorflow/lite/python/lite.py", line 505, in convert
    constants.FLOAT, True)
  File "/opt/anaconda/3/envs/P3.7.4_TF2.2.0.dev20200508/lib/python3.7/site-packages/tensorflow/lite/python/lite.py", line 337, in _calibrate_quantize_model
    calibrate_quantize = _calibrator.Calibrator(result)
  File "/opt/anaconda/3/envs/P3.7.4_TF2.2.0.dev20200508/lib/python3.7/site-packages/tensorflow/lite/python/optimize/calibrator.py", line 53, in __init__
    raise ValueError("Failed to parse the model: %s." % e)
ValueError: Failed to parse the model: pybind11::init(): factory function returned nullptr.
tensorflow/tensorflow

Answer questions renjie-liu

Hi YC, do you have any idea about this?

Thanks!

useful!

Related questions

ModuleNotFoundError: No module named 'tensorflow.contrib' hot 9
Tf.Keras metrics issue hot 8
Error occurred when finalizing GeneratorDataset iterator hot 7
Error loading tensorflow hot 6
module 'tensorflow' has no attribute 'ConfigProto' hot 6
TF 2.0 'Tensor' object has no attribute 'numpy' while using .numpy() although eager execution enabled by default hot 6
tensorflow-gpu CUPTI errors
Lossy conversion from float32 to uint8. Range [0, 1]. Convert image to uint8 prior to saving to suppress this warning.
ModuleNotFoundError: No module named 'tensorflow.contrib'
When importing TensorFlow, error loading Hadoop
OSError: SavedModel file does not exist at: saved_model_dir/{saved_model.pbtxt|saved_model.pb}
AttributeError: module &#39;tensorflow.python.framework.op_def_registry&#39; has no attribute &#39;register_op_list&#39;
tf.keras.layers.Conv1DTranspose ?
[TF 2.0] tf.keras.optimizers.Adam hot 4
TF2.0 AutoGraph issue hot 4
source:https://uonfu.com/
Github User Rank List