deformer icon indicating copy to clipboard operation
deformer copied to clipboard

Error running command from README for benchmarking inference latency

Open revanthky opened this issue 3 years ago • 0 comments

Hello,

I was able to follow the README to run the evaluation on the Bert and EBert models using the provided checkpoints. When I moved into the profiling section, I successfully ran the flop profiling as well as the inference latency benchmarking for the Ebert model. However, there was an error when I tried to run the given inference latency benchmarking for the provided Bert model.

I was able to see that the error came from line 33 in bert.py. The model specified in qa_bert.py does not provide the right shape for the "inputs" variable that is used to extract the "input_ids" and "token_type_ids" in this line. I was able to get past this error by changing this in qa_bert.py, creating another Tensor placeholder for segment_ids_ph (with the same dimensions as the placeholder for input_ids_ph) in the export_graph function (that was previously commented out, line 94), and then included both of these tensors so that the implicit function call to the "call" method of the model in bert.py would have the correct "inputs" variable.

I wanted to ensure that this would be a correct way to fix this issue, to check whether or not I am using the repository correctly. I have attached a picture of the updated code.

Screenshot (10)

Thank you!

revanthky avatar Aug 06 '20 20:08 revanthky