Didn't find op for builtin opcode 'PAD' version '1'
Hi @Hacktiv8or,

```
    resolver.AddCustom("PAD", tflite::ops::custom::Register_PAD(), 1, 2);
  // resolver.AddCustom("PAD", tflite::Register_PADV2(), 1, 1);
```

Could you please confirm you are getting the same error with PADV2() op instead of PAD().

Thank You

 This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62651">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62651">No</a>

### Issue type

Others

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.8.0

### Custom code

Yes

### OS platform and distribution

Windows, ESP32-cam

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I wrote a code to read a **.tflite model** file from inbuilt SD Card of **ESP32-CAM** and use it to do detection.
### Error--> Didn't find op for builtin opcode 'PAD' version '1'


### **Serial Monitor-**
```
[   464][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
Didn't find op for builtin opcode 'PAD' version '1'


Failed to get registration from op code  d
 

AllocateTensors() failed

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400d2d5c  PS      : 0x00060830  A0      : 0x800e94f4  A1      : 0x3ffdaf70  
A2      : 0x3ffd6234  A3      : 0x00000000  A4      : 0x3ffc3970  A5      : 0x3ffc3978  
A6      : 0x3ffbd720  A7      : 0x80000001  A8      : 0x800d2f8c  A9      : 0x3ffdaf30  
A10     : 0x00000000  A11     : 0x00000060  A12     : 0x00000060  A13     : 0x00000001  
A14     : 0x00011800  A15     : 0x3ffc3978  SAR     : 0x0000001e  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000004  LBEG    : 0x4008a02d  LEND    : 0x4008a03d  LCOUNT  : 0xffffffff  

Backtrace: 0x400d2d59:0x3ffdaf70 0x400e94f1:0x3ffdaf90

ELF file SHA256: 95a2e245985e3dfa

Rebooting...
```
### **My Code--**
```

/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include <TensorFlowLite_ESP32.h>

#include "main_functions.h"

#include "detection_responder.h"
#include "image_provider.h"
#include "model_settings.h"
// #include "person_detect_model_data.h"

#include"SD_MMC.h"
#include "FS.h"

#include "tensorflow/lite/experimental/micro/kernels/micro_ops.h"
#include "tensorflow/lite/experimental/micro/micro_error_reporter.h"
#include "tensorflow/lite/experimental/micro/micro_interpreter.h"
// #include "tensorflow/lite/experimental/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/experimental/micro/kernels/all_ops_resolver.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"

#include "custom_op.h"

// Globals, used for compatibility with Arduino-style sketches.
namespace {
tflite::ErrorReporter* error_reporter = nullptr;
const tflite::Model* model = nullptr;
tflite::MicroInterpreter* interpreter = nullptr;
TfLiteTensor* input = nullptr;

// An area of memory to use for input, output, and intermediate arrays.
constexpr int kTensorArenaSize = 70 * 1024;
static uint8_t tensor_arena[kTensorArenaSize];
}  // namespace

// The name of this function is important for Arduino compatibility.
void setup() {
  SD_MMC.begin();
  // Set up logging. Google style is to avoid globals or statics because of
  // lifetime uncertainty, but since this has a trivial destructor it's okay.
  // NOLINTNEXTLINE(runtime-global-variables)
  static tflite::MicroErrorReporter micro_error_reporter;
  error_reporter = &micro_error_reporter;

  // Map the model into a usable data structure. This doesn't involve any
  // copying or parsing, it's a very lightweight operation.
  File modelFile = SD_MMC.open("/models/yolov5n-int8.tflite", FILE_READ);
  if (!modelFile) { Serial.println("Failed to open model file"); return; }
  size_t modelSize = modelFile.size();
  uint8_t *modelData = (uint8_t*)malloc(modelSize); // allocates 2.1MB in heap 
  modelFile.read(modelData, modelSize); // reads the model file
  modelFile.close();
  model = tflite::GetModel(modelData);
  if (model->version() != TFLITE_SCHEMA_VERSION) {
    error_reporter->Report(
        "Model provided is schema version %d not equal "
        "to supported version %d.",
        model->version(), TFLITE_SCHEMA_VERSION);
    return;
  }

  // Pull in only the operation implementations we need.
  // This relies on a complete list of all the ops needed by this graph.
  // An easier approach is to just use the AllOpsResolver, but this will
  // incur some penalty in code space for op implementations that are not
  // needed by this graph.
  //
  // tflite::ops::micro::AllOpsResolver resolver;
  // NOLINTNEXTLINE(runtime-global-variables)

  static tflite::ops::micro::AllOpsResolver resolver;
  // static tflite::MicroMutableOpResolver resolver;
  // static tflite::MicroMutableOpResolver<10> resolver;
  // resolver.AddPad(); // no attr AddPad 
  // resolver.AddPadV2();
  resolver.AddCustom("PAD", tflite::ops::custom::Register_PAD(), 1, 2);
  // resolver.AddCustom("PAD", tflite::Register_PADV2(), 1, 1);

  // Build an interpreter to run the model with.
  static tflite::MicroInterpreter static_interpreter(
      model, resolver, tensor_arena, kTensorArenaSize,
      error_reporter);
  interpreter = &static_interpreter;

  // Allocate memory from the tensor_arena for the model's tensors.
  TfLiteStatus allocate_status = interpreter->AllocateTensors();
  if (allocate_status != kTfLiteOk) {
    error_reporter->Report("AllocateTensors() failed");
    return;
  }

  // Get information about the memory area to use for the model's input.
  input = interpreter->input(0);
}

// The name of this function is important for Arduino compatibility.
void loop() {
  // Get image from provider.
  if (kTfLiteOk != GetImage(error_reporter, kNumCols, kNumRows, kNumChannels,
                            input->data.uint8)) {
    error_reporter->Report("Image capture failed.");
  }

  // Run the model on this input and make sure it succeeds.
  if (kTfLiteOk != interpreter->Invoke()) {
    error_reporter->Report("Invoke failed.");
  }

  TfLiteTensor* output = interpreter->output(0);

  // Process the inference results.
  // error_reporter->Report(String(typeid(output->data.uint8).name()).c_str());
  uint8_t person_score = output->data.uint8[kPersonIndex];
  uint8_t no_person_score = output->data.uint8[kNotAPersonIndex];  
  RespondToDetection(error_reporter, person_score, no_person_score);
}

```

### Standalone code to reproduce the issue

```shell
###My Code--


/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include <TensorFlowLite_ESP32.h>

#include "main_functions.h"

#include "detection_responder.h"
#include "image_provider.h"
#include "model_settings.h"
// #include "person_detect_model_data.h"

#include"SD_MMC.h"
#include "FS.h"

#include "tensorflow/lite/experimental/micro/kernels/micro_ops.h"
#include "tensorflow/lite/experimental/micro/micro_error_reporter.h"
#include "tensorflow/lite/experimental/micro/micro_interpreter.h"
// #include "tensorflow/lite/experimental/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/experimental/micro/kernels/all_ops_resolver.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"

#include "custom_op.h"

// Globals, used for compatibility with Arduino-style sketches.
namespace {
tflite::ErrorReporter* error_reporter = nullptr;
const tflite::Model* model = nullptr;
tflite::MicroInterpreter* interpreter = nullptr;
TfLiteTensor* input = nullptr;

// An area of memory to use for input, output, and intermediate arrays.
constexpr int kTensorArenaSize = 70 * 1024;
static uint8_t tensor_arena[kTensorArenaSize];
}  // namespace

// The name of this function is important for Arduino compatibility.
void setup() {
  SD_MMC.begin();
  // Set up logging. Google style is to avoid globals or statics because of
  // lifetime uncertainty, but since this has a trivial destructor it's okay.
  // NOLINTNEXTLINE(runtime-global-variables)
  static tflite::MicroErrorReporter micro_error_reporter;
  error_reporter = &micro_error_reporter;

  // Map the model into a usable data structure. This doesn't involve any
  // copying or parsing, it's a very lightweight operation.
  File modelFile = SD_MMC.open("/models/yolov5n-int8.tflite", FILE_READ);
  if (!modelFile) { Serial.println("Failed to open model file"); return; }
  size_t modelSize = modelFile.size();
  uint8_t *modelData = (uint8_t*)malloc(modelSize); // allocates 2.1MB in heap 
  modelFile.read(modelData, modelSize); // reads the model file
  modelFile.close();
  model = tflite::GetModel(modelData);
  if (model->version() != TFLITE_SCHEMA_VERSION) {
    error_reporter->Report(
        "Model provided is schema version %d not equal "
        "to supported version %d.",
        model->version(), TFLITE_SCHEMA_VERSION);
    return;
  }

  // Pull in only the operation implementations we need.
  // This relies on a complete list of all the ops needed by this graph.
  // An easier approach is to just use the AllOpsResolver, but this will
  // incur some penalty in code space for op implementations that are not
  // needed by this graph.
  //
  // tflite::ops::micro::AllOpsResolver resolver;
  // NOLINTNEXTLINE(runtime-global-variables)

  static tflite::ops::micro::AllOpsResolver resolver;
  // static tflite::MicroMutableOpResolver resolver;
  // static tflite::MicroMutableOpResolver<10> resolver;// number of total operators we want to use ... okcan be more than that also ...
  // resolver.AddPad(); // no attr AddPad 
  // resolver.AddPadV2();
  resolver.AddCustom("PAD", tflite::ops::custom::Register_PAD(), 1, 2);
  // resolver.AddCustom("PAD", tflite::Register_PADV2(), 1, 1);

  // Build an interpreter to run the model with.
  static tflite::MicroInterpreter static_interpreter(
      model, resolver, tensor_arena, kTensorArenaSize,
      error_reporter);
  interpreter = &static_interpreter;

  // Allocate memory from the tensor_arena for the model's tensors.
  TfLiteStatus allocate_status = interpreter->AllocateTensors();
  if (allocate_status != kTfLiteOk) {
    error_reporter->Report("AllocateTensors() failed");
    return;
  }

  // Get information about the memory area to use for the model's input.
  input = interpreter->input(0);
}

// The name of this function is important for Arduino compatibility.
void loop() {
  // Get image from provider.
  if (kTfLiteOk != GetImage(error_reporter, kNumCols, kNumRows, kNumChannels,
                            input->data.uint8)) {
    error_reporter->Report("Image capture failed.");
  }

  // Run the model on this input and make sure it succeeds.
  if (kTfLiteOk != interpreter->Invoke()) {
    error_reporter->Report("Invoke failed.");
  }

  TfLiteTensor* output = interpreter->output(0);

  // Process the inference results.
  // error_reporter->Report(String(typeid(output->data.uint8).name()).c_str());
  uint8_t person_score = output->data.uint8[kPersonIndex];
  uint8_t no_person_score = output->data.uint8[kNotAPersonIndex];  
  RespondToDetection(error_reporter, person_score, no_person_score);
}

```
```


### Relevant log output

```shell
[   464][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
Didn't find op for builtin opcode 'PAD' version '1'


Failed to get registration from op code  d
 

AllocateTensors() failed

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400d2d5c  PS      : 0x00060830  A0      : 0x800e94f4  A1      : 0x3ffdaf70  
A2      : 0x3ffd6234  A3      : 0x00000000  A4      : 0x3ffc3970  A5      : 0x3ffc3978  
A6      : 0x3ffbd720  A7      : 0x80000001  A8      : 0x800d2f8c  A9      : 0x3ffdaf30  
A10     : 0x00000000  A11     : 0x00000060  A12     : 0x00000060  A13     : 0x00000001  
A14     : 0x00011800  A15     : 0x3ffc3978  SAR     : 0x0000001e  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000004  LBEG    : 0x4008a02d  LEND    : 0x4008a03d  LCOUNT  : 0xffffffff  


Backtrace: 0x400d2d59:0x3ffdaf70 0x400e94f1:0x3ffdaf90




ELF file SHA256: 95a2e245985e3dfa

Rebooting...
```
