New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quantization AssertionError "inputs len must equal with input_tensor" #34
Comments
I think I figured out the error with the inputs. I think it might have had to do with the fact that I'm starting from a saved_model.pb which has inputs different than the example. I ended up using a Datasets class more similar the TFBERTDataSets class from examples/engine/nlp/bert_base_mrpc/utils.py. Now, my output looks like this:
Toward the middle of that output it's saying |
could you pls paste the whole log? As you specified the metric and eval_dataloader, neural compressor should construct the evaluation process in internal. the duration should not be 0. but in your log, the duration is 0. looks like fake_eval func is invoked. if it's true, "Generate a fake evaluation function" debug message will be printed. did you see that? |
@ftian1 Thanks, your response helped me to figure out a bit what was going on. Since I switched to follow the example from I put back in the
and then setting the metric like:
Now, my full output looks like this:
Does this look correct? I did see some warnings in the log, so not sure if there are other things that I'm doing wrong. |
I have the same error? but I don't know how to reslove
|
cc @chensuyue |
@GuoGuiRong Sorry for the late reply, may I know if the issue still there? |
Hi @chensuyue, I am seeing this same error for MaskRCNN_resnet50. I am providing publicly available mask_rcnn_coco weights(frozen .pb file) as input_model. |
Thanks for your feedback, could you provide the public link of the MaskRCNN_resnet50 model? |
https://github.com/matterport/Mask_RCNN/releases/tag/v2.0 Here is the model file in H5 format. I converted it to frozen form(pb). |
@zehao-intel pls check. |
Yes. I will track it. |
Hi @asirvaiy, the h5 file in the link you provided only contains weights. You need to use the main repo for MaskRCNN TF model to load this weight file to make it a complete model. Did you try this? |
Hi @zehao-intel, I have used this https://github.com/Amith4504/Frozen-Graph-Inference-MaskRCNN to convert .h5 to .pb |
Hi @asirvaiy. |
This "inputs len must equal with input_tensor" error occurs when the number of input data is not equal to the number of input tensors. I have used correct input settings and preprocessing from the MaskRCNN repo to feed correct data. The model can be quantized with real data now. |
* fixed nightly test error for examples * change the folder for qat and ptq examples
I'm following the TensorFlow BERT MRPC example to run the neural compressor with a saved model that I exported after fine tuning BERT from the Intel Model Zoo using the IMDB movie review sentiment analysis dataset. The training task for this was "cola" instead of "mrpc", but I still used run_classifier.py to train the model.
I used the same
Dataset
class definition andcollate_fn
from the example and my yaml has:My python code looks like this:
This is failing with the following error:
The input_tensor for my model looks like this so I'm assuming that length is 4. What is other
inputs
that's being checked in the error above that has a different length than the input tensor?Any suggestions on how to resolve this issue?
The text was updated successfully, but these errors were encountered: