ClassNotFoundException when creating a new Model
@ThomasRichtsfeld Could you please let us know the TF version you are using?
Please refer to [Build from Source ](https://www.tensorflow.org/install/source) and [GPU acceleration delegate ](https://www.tensorflow.org/lite/android/delegates/gpu). Could you please create the delegate with TfLiteGpuDelegateV2Create() in the latest version.

 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. > Could you please let us know the TF version you are using?

Can you elaborate on this? I am not quite sure which exact library you are referring to. I listed the dependencies in the post above. 

> Could you please create the delegate with TfLiteGpuDelegateV2Create() in the latest version.

Which delegate do you mean?

All the code that is causing the problem comes with the `com.google.android.gms:play-services-tflite` dependencies.

Or are you talking about the tf lite model itself? I am just the stakeholder using that model
 Hi @ThomasRichtsfeld, Can you please make a PR with your suggested changes? We will review it. Thanks! @pkgoogle Can you point me to the source of `org.tensorflow.lite.support.model.GpuDelegateProxy`? I can't find it easily in this repo. 
Is this also the one that is shipped via the **Play Services**? I am a bit confused about the old tf lite stuff and the new one that is shipped through the play services. I am not sure if the sources are the same No worries, @ThomasRichtsfeld, is this what you are looking for? https://github.com/tensorflow/tflite-support/blob/master/tensorflow_lite_support/java/src/java/org/tensorflow/lite/support/model/GpuDelegateProxy.java Yep, that is what I was looking for. Thanks.
One question, if we update this class now and you release a new version, where is this reflected? In the stand-alone TensorFlow Lite or in the Play services API? Np, It should be reflected in both, assuming we keep supporting both workflows. @pkgoogle do you know how I can get the permission for pushing branches? I get back a 403 Hi @ThomasRichtsfeld,

Please ensure you are following this link: https://github.com/tensorflow/tensorflow/blob/master/CONTRIBUTING.md

Generally you can't push branches directly, you need to make a PR, let me know if you run into any trouble following that. > Generally you can't push branches directly, you need to make a PR, let me know if you run into any trouble following that.

Yes, but how can I open a PR without the changes being pushed to a branch? Hi @ThomasRichtsfeld, I don't think I'm understanding your issue currently. Can you show me the exact git steps you use and the error you get. Please include context such as if you forked the repo/what branches you are in. Thanks! - I cloned the repo you sent me
- Created a branch 
- Fixed the issue
- Tried to push the branch (This is where the error happened)

I didn't fork the repo Hi @ThomasRichtsfeld, Thanks for the info, can you:

1. Fork the repo
2. Update your fork with your fix
3. Merge your fork back in by making a PR

Here's an example PR: https://github.com/tensorflow/tensorflow/pull/61877

Let me know if that works for you. Hi @ThomasRichtsfeld ,

Firstly, thank you for reporting this issue!

Secondly, if you're having trouble creating a PR, feel free to just attach a patch file here. I have made a fix for this. Hi @fergushenderson, wondering if you have a link to the PR or if it has already merged? Thanks for any update. The PR is this one:
https://github.com/tensorflow/tflite-support/commit/e4bc12500c1ae3110c11345c8d93599515013b55

It was merged on November 21st. Hi @ThomasRichtsfeld, can you please verify that your issue is now resolved? Thanks! 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/61716">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/61716">No</a>

We get a class not found exception when calling

```
Model.createModel(
            FileUtil.loadMappedFile(
                TfLiteFileProvider(
                    context!!
                ).getModelFile(modelFileName)
            ),
            modelFileName,
            runningOptions!!
        )
```
The problem is that inside `GpuDelegateProxy` you are using reflection that creates `org.tensorflow.lite.gpu.GpuDelegate`. This dependency is not part of the play services dependencies anymore. It should rather point to `com.google.android.gms.tflite.gpu.GpuDelegate`.

#### Dependencies

```
tflite_vision = { module = "org.tensorflow:tensorflow-lite-task-vision-play-services", version= "0.4.4" }
tflite_gpu = { module = "com.google.android.gms:play-services-tflite-gpu", version = "16.1.0" }
tflite_java = { module = "com.google.android.gms:play-services-tflite-java", version = "16.0.1" }
tflite_support = { module = "com.google.android.gms:play-services-tflite-support", version = "16.0.1" }
tflite_metadata = { module = "org.tensorflow:tensorflow-lite-metadata", version = "0.4.0" }
```
#### Crash Log

```
Failed to create the GpuDelegate dynamically.
java.lang.ClassNotFoundException: org.tensorflow.lite.gpu.GpuDelegate
	at java.lang.Class.classForName(Native Method)
	at java.lang.Class.forName(Class.java:454)
	at java.lang.Class.forName(Class.java:379)
	at org.tensorflow.lite.support.model.GpuDelegateProxy.maybeNewInstance(GpuDelegateProxy.java:38)
	at org.tensorflow.lite.support.model.Model.createModel(Model.java:204)
	at com..kcc.domain.usecase.poseestimation.Model2Stack257.<init>(Model2Stack257.kt:170)
	at com..kcc.domain.usecase.InferPoseModelTFLiteUseCase.tfModel$lambda$0(InferPoseModelTFLiteUseCase.kt:27)
	at com..kcc.domain.usecase.InferPoseModelTFLiteUseCase.$r8$lambda$xjFI4TuW8y9D4mlU8833KNnigbg(Unknown Source:0)
	at com..kcc.domain.usecase.InferPoseModelTFLiteUseCase$$ExternalSyntheticLambda0.then(Unknown Source:2)
	at com.google.android.gms.tasks.zzc.run(com.google.android.gms:play-services-tasks@@18.0.2:3)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:313)
	at android.app.ActivityThread.main(ActivityThread.java:8757)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.tensorflow.lite.gpu.GpuDelegate" on path: DexPathList[[zip file "/data/app/~~7PczWMC5IEgE71QUXcKhDQ==/com..mt-cQ_JVkbM4HelJiyQApEttQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~7PczWMC5IEgE71QUXcKhDQ==/com..mt-cQ_JVkbM4HelJiyQApEttQ==/lib/arm64, /data/app/~~7PczWMC5IEgE71QUXcKhDQ==/com..mt-cQ_JVkbM4HelJiyQApEttQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/s
	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
	at java.lang.Class.classForName(Native Method) 
	at java.lang.Class.forName(Class.java:454) 
	at java.lang.Class.forName(Class.java:379) 
	at org.tensorflow.lite.support.model.GpuDelegateProxy.maybeNewInstance(GpuDelegateProxy.java:38) 
	at org.tensorflow.lite.support.model.Model.createModel(Model.java:204) 
	at com..kcc.domain.usecase.poseestimation.Model2Stack257.<init>(Model2Stack257.kt:170) 
	at com..kcc.domain.usecase.InferPoseModelTFLiteUseCase.tfModel$lambda$0(InferPoseModelTFLiteUseCase.kt:27) 
	at com..kcc.domain.usecase.InferPoseModelTFLiteUseCase.$r8$lambda$xjFI4TuW8y9D4mlU8833KNnigbg(Unknown Source:0) 
	at com..kcc.domain.usecase.InferPoseModelTFLiteUseCase$$ExternalSyntheticLambda0.then(Unknown Source:2) 
	at com.google.android.gms.tasks.zzc.run(com.google.android.gms:play-services-tasks@@18.0.2:3) 
	at android.os.Handler.handleCallback(Handler.java:942) 
	at android.os.Handler.dispatchMessage(Handler.java:99) 
	at android.os.Looper.loopOnce(Looper.java:226) 
	at android.os.Looper.loop(Looper.java:313) 
	at android.app.ActivityThread.main(ActivityThread.java:8757) 
```
