Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Model Optimizer: Dropout Layer



one month ago, I already managed to use the MO to generate the IR files for this simple model but now I can't generate the IR files for the same model, I get this error:

[ ERROR ]  Cannot infer shapes or values for node "dropout_4/cond/dropout/Cast".
[ ERROR ]  NodeDef mentions attr 'Truncate' not in Op<name=Cast; signature=x:SrcT -> y:DstT; attr=SrcT:type; attr=DstT:type>; NodeDef: dropout_4/cond/dropout/Cast = Cast[DstT=DT_FLOAT, SrcT=DT_BOOL, Truncate=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_dropout_4/cond/dropout/GreaterEqual_port_0_ie_placeholder_0_0). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
         [[Node: dropout_4/cond/dropout/Cast = Cast[DstT=DT_FLOAT, SrcT=DT_BOOL, Truncate=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_dropout_4/cond/dropout/GreaterEqual_port_0_ie_placeholder_0_0)]]

I know that MO does not need the dropout layer for inference but MO support the dropout layer. I´m using the same code and same command: --input_model C:\Users\andre\Desktop\modelo_mnist\model_alteracao_kernel_teste.pb --input_shape [1,28,28,1]  --data_type=FP16

I'm using Keras and I can't eliminate Dropout layer because I need her for training and for generate the pb file.

I don't understand why I have already been able to generate the IR files and not now.


the model:

model = models.Sequential()
model.add(layers.Conv2D(16, 3, activation='relu', input_shape=(28, 28, 1)))
model.add(layers.Conv2D(32, 3, activation='relu'))
model.add(layers.MaxPool2D(pool_size=(3, 3),strides=(2,2)))
model.add(layers.Conv2D(64, 3, activation='relu'))
model.add(layers.MaxPool2D(pool_size=(3, 3),strides=(2,2)))
model.add(layers.Dense(256, activation='relu'))
model.add(layers.Dense(10, activation='softmax'))




0 Kudos
0 Replies