0

So, I followed the instructions and ran the script to export my model after training was done. Now, I don't know why, but I keep getting this error:

> ValueError: Tensor's shape (3, 3, 256, 12) is not compatible with
> supplied shape (3, 3, 256, 546)

What could be the issue?

1
  • Can you try to follow the steps that mentioned here and let us know the update. Thanks! Commented Jan 14, 2021 at 17:13

1 Answer 1

1

I had the same issue trying to export a model with the Object Detection API, in my case I was using the model "ssd_resnet50_v1_fpn_640x640_coco17_tpu-8" from Model Zoo.

Basically, you have to:

  1. Save checkpoints of your fine-tuned model.

  2. Modify the "pipeline.config" file of the model you retrained in order to match the number of classes of your custom dataset; i.e, changing the value of "num_classes" properly (If the number of classes is not properly set, then the shapes of the graph won't match)

  3. Use the exporter_main_v2 helper function to export the model for inference with the files you generated in steps 1 and 2.

I guess that you did steps 1 and 3, but not step 2.

I provide a detailed explanation of this solution in this notebook, where few shot fine-tuning on a custom dataset is performed and the resulting model is exported, loaded and tested.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.