Skip to content
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

Input shape mismatch: Input 'input' has shape 1,224,224,3, but input data is of length 519168 #5855

Open
alzubitariq opened this issue Jun 22, 2021 · 1 comment
Labels
need info This issue needs more info before triage onnx Exporting ONNX models or loading ONNX models

Comments

@alzubitariq
Copy link

System information

  • OS version/distro:
  • Windows 10:

Issue

  • What did you do?

  • Converted TensorFlow model to ONNX over this command python -m tf2onnx.convert --saved-model ./checkpoints/yolov4.tf --output model.onnx --opset 11 --verbose and then imported the output file and then i changed the input and output from the sample provided by Microsoft

  • What happened?

  • This is the output

  • Model location: .....assets\Model\nsfw_mobilenet.onnx
    Default parameters: image size=(416,416)
    System.InvalidOperationException: Input shape mismatch: Input 'input' has shape 1,224,224,3, but input data is of length 519168.
    at Microsoft.ML.Transforms.Onnx.OnnxTransformer.Mapper..ctor(OnnxTransformer parent, DataViewSchema inputSchema)
    at Microsoft.ML.Transforms.Onnx.OnnxTransformer.MakeRowMapper(DataViewSchema inputSchema)
    at Microsoft.ML.Data.RowToRowTransformerBase.GetOutputSchema(DataViewSchema inputSchema)
    at Microsoft.ML.Data.TrivialEstimator1.Fit(IDataView input) at Microsoft.ML.Data.EstimatorChain1.Fit(IDataView input)
    at ObjectDetection.OnnxModelScorer.LoadModel(String modelLocation) in Downloads\machinelearning_samples\machinelearning\samples\csharp\getting-started\DeepLearning_ObjectDetection_Onnx\ObjectDetectionConsoleApp\OnnxModelScorer.cs:line 63
    at ObjectDetection.OnnxModelScorer.Score(IDataView data) in Downloads\machinelearning_samples\machinelearning\samples\csharp\getting-started\DeepLearning_ObjectDetection_Onnx\ObjectDetectionConsoleApp\OnnxModelScorer.cs:line 84
    at ObjectDetection.Program.Main() in Downloads\machinelearning_samples\machinelearning\samples\csharp\getting-started\DeepLearning_ObjectDetection_Onnx\ObjectDetectionConsoleApp\Program.cs:line 36
    ========= End of Process..Hit any Key ========

  • What did you expect?

  • it should work

and here is the onnx file
nsfw_mobilenet.zip

Source code / logs

Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.

@michaelgsharp michaelgsharp added the onnx Exporting ONNX models or loading ONNX models label Jul 22, 2021
@michaelgsharp
Copy link
Member

Can you share the pipeline code you are using when trying to use that model?

@michaelgsharp michaelgsharp added the need info This issue needs more info before triage label Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info This issue needs more info before triage onnx Exporting ONNX models or loading ONNX models
Projects
None yet
Development

No branches or pull requests

2 participants