Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Hello I'm quite new to workbench and I've two problems concerning int8 optimization

    My objective is to optimize and calibrate my model for INT8 usage.

    After saving the model from tensorflow2 to the saved_model format, the input dimension is (None, 128,128,1). At the import step at the workbench, I set the dimensions to (1,128,128,1) for batch 1 and I set the image colorspace to grayscale. Processing with 11 files in the standard mode works fine and gives measurement results.

    After that I tried to optimize with tpot. There I got the following error message:


    File "/opt/intel/openvino/deployment_tools/tools/post_training_optimization_toolkit/libs/open_model_zoo/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher.py", line 840, in fit_to_input

    return self._align_data_shape(data, layer_name, layout)

    File "/opt/intel/openvino/deployment_tools/tools/post_training_optimization_toolkit/libs/open_model_zoo/tools/accuracy_checker/accuracy_checker/launcher/dlsdk_launcher.py", line 606, in _align_data_shape

    return data.reshape(input_shape) if not self.disable_resize_to_input else data

    ValueError: cannot reshape array of size 49152 into shape (1,1,128,128)

    => As 49152/128/128 =3, it seems that it is not handled as grayscale?
    Vladimir Golubenko
    Hi @andife ,
    It seems like you are trying to perform Accuracy Aware optimization on a grayscale network with RGB images. Accuracy Checker does not perform RGB to grayscale conversion unless an explicit instruction is provided. You can attempt to fix your issue using one of the following:
    1) Transform your images to grayscale manually and attempt to calibrate with the new images.
    2) Alter your accuracy configuration. To do this, visit the accuracy measurement menu and, under the Advanced setting, add the following parameter to the preprocessing section of your existing config: type: rgb_to_gray (or brg_to_gray, depending on your images' format). After that, click "Run Accuracy Check" to save the results and calibrate again.