Error in loading YOLOv4 TFlite model in Flutter - c

I have loaded my custom YOLOv4 TFlite model on Flutter based on this repo by TexMexMax. I already followed all the instructions in the README.md but still got these errors:
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/tflite_flutter-0.5.0/lib/src/delegates/gpu_delegate.dart:58:10: Error: The getter 'addressOf' isn't defined for the class 'TfLiteGpuDelegateOptionsV2'.
- 'TfLiteGpuDelegateOptionsV2' is from 'package:tflite_flutter/src/bindings/types.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/tflite_flutter-0.5.0/lib/src/bindings/types.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.
.addressOf);
^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-1.7.4+1/lib/src/structs.dart:2992:7: Error: Struct 'STATSTG' is empty. Empty structs and unions are undefined behavior.
class STATSTG extends Struct {}
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/tflite_flutter-0.5.0/lib/src/bindings/types.dart:6:7: Error: Struct 'TfLiteInterpreter' is empty. Empty structs and unions are undefined behavior.
class TfLiteInterpreter extends Struct {}
^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/allocation.dart:47:33: Error: Expected type 'T' to be a valid and instantiated subtype of 'NativeType'.
final int totalSize = count * sizeOf<T>();
There are list of errors similar to the above but with different functions(?). Then the errors ended with below:
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 10s
Exception: Gradle task assembleDebug failed with exit code 1
I also tried some of the solutions here but still no luck. Apparently, according to this author, the TFLite plugins in Flutter doesn't support YOLOv4 yet hence I followed the repo by TexMaxMex since they had modified something so that Flutter could support the YOLOv4 model but then I encountered those errors.
Hope someone could enlighten me why is this happening and what should I do to assist the problems. Thank you in advance!

Related

Codenameone: Android Build Failed with strange exception

Since today (28.03.) the build of my app (CN1 build server) throws an build Exception which I don't understand. The Build yesterday worked without an error. The error from the error-log:
Dex: The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$8.updateIndex(DexMerger.java:565)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:276)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:574)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:166)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1689)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
:transformDexArchiveWithDexMergerForDebug FAILED
:transformDexArchiveWithDexMergerForDebug (Thread[Daemon worker,5,main]) completed. Took 0.334 secs.
FAILURE: Build failed with an exception.
Can anybody help me to understand what went wrong?
The error is:
Dex: The number of method references in a .dex file cannot exceed 64K.
In this case, add the build hint:
android.multidex=true
As written in the developer guide (link):
android.multidex -> Boolean true/false defaults to false. Multidex
allows Android binaries to reference more than 65536 methods. This
slows builds a bit so we have it off by default but if you get a build
error mentioning this limit you should turn this on.

Android Manifest merger error in Codename One

In a bare bones project, I added these build hints:
android.gradleDep=compile 'com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5'
android.min_sdk_version=23
I would like to import the following Android library to make a CN1Lib (that requires at least Android SDK 23):
https://github.com/erikagtierrez/multiple-media-picker
To be short: I spent one day trying to import that, I also experimented with Android Studio and with suggestions found on Stack Overflow (trying to make a custom .aar), without success.
Could you help me to import that library? There is manifest merger error.
In fact, the issue reported by the build server is:
* What went wrong:
Execution failed for task ':processReleaseManifest'.
> Manifest merger failed : Attribute application#label value=(BareBones) from AndroidManifest.xml:15:17-42
is also present at [com.erikagtierrez.multiple_media_picker:multiple-media-picker:1.0.5] AndroidManifest.xml:23:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:15:3-43:103 to override.
I also tried to add the build hint:
android.xapplication_attr=tools:replace="android:label"
as suggested by the previous error, without success.
In the last case, I get:
Merging result: ERROR
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml:15:3-43:103 Error:
tools:replace specified at line:15 for attribute android:label, but no new value specified
/tmp/build1659178556337293135xxx/Test/src/main/AndroidManifest.xml Error:
Validation failed, exiting
-- Merging decision tree log ---
The last full log is here: https://gist.github.com/jsfan3/dd6c23f86a2ac949f996910c8cece62b
Thank you
This is happening because our code things you injected android:label on your own and doesn't inject it to avoid collision...
Change the code to this:
android.xapplication_attr=tools:replace="android:label" android:label="App Name"

Poky-sumo : nothing provides kernel-module-hello... error

we are currently updating our poky environment to the sumo branch and one of our recipes that build a kernel module does not work anymore. I get the following error when building image rootfs :
- nothing provides kernel-module-ourmodule-4.14.73-linux4sam_6.0-00005-g871f191fa293 needed by ourmodule.ourtarget
This recipe was working with previous version of yocto.
For testing, I made a copy of meta-skeleton/recipes-kernel/hello-mod in our layer, added hello-mod package in our image and built the image. I have the same kind of error:
Collected errors:
* Solver encountered 1 problem(s):
* Problem 1/1:
* - nothing provides kernel-module-hello-4.14.73-linux4sam_6.0-00005-g871f191fa293 needed by hello-mod-0.1-r0.our_target
*
* Solution 1:
* - do not ask to install a package providing hello-mod
Any help is welcome.
Thanks
In My case it was the following issue:
I had the module installed in a non standard kernel-module dir, when removing this it was fixed by adding
RPROVIDES_${PN} += "kernel-module-${PN}"
to the recipe.

Akeneo 2.2.5: No JobInstance found with code "add_to_existing_product_model"

Since the forum at akeneo.com is locked down, I posted my question here.
When I try to add Produkts to a Product-Model via mass-edit, I get the following error message:
No JobInstance found with code "add_to_existing_product_model"
[2018-06-19 19:39:31] request.INFO: Matched route "pim_enrich_mass_edit_rest_launch". {"route":"pim_enrich_mass_edit_rest_launch","route_parameters":{"_controller":"pim_enrich.controller.rest.mass_edit:launchAction","_route":"pim_enrich_mass_edit_rest_launch"},"request_uri":"http://pim.eu-trading.eu/rest/mass_edit/","method":"POST"} []
[2018-06-19 19:39:32] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Translation\Exception\NotFoundResourceException: "No JobInstance found with code "add_to_existing_product_model"" at ./vendor/akeneo/pim-community-dev/src/Pim/Bundle/EnrichBundle/MassEditAction/OperationJobLauncher.php line 59 {"exception":"[object] (Symfony\\Component\\Translation\\Exception\\NotFoundResourceException(code: 0): No JobInstance found with code \"add_to_existing_product_model\" at ./vendor/akeneo/pim-community-dev/src/Pim/Bundle/EnrichBundle/MassEditAction/OperationJobLauncher.php:59)"} []
I get this error with the latest version of Akeneo 2 (v2.2.5). The product model was created manually, the products to be associated with the model came through the api.
This error looks like a missing job in the database. Did you run all the doctrine migrations?
To do so you need to launch this command:
bin/console doctrine:migrations:migrate --env=prod
If you already launched the migrations and they failed, you can install a clean 2.2.5 PIM elsewhere and dump the job instance table to be able to add the missing jobs. Here is the list of the jobs to add or update in 2.2:
- add_association
- move_to_category
- add_to_category
- remove_from_category
- add_to_existing_product_model
- compute_family_variant_structure_changes
- compute_completeness_of_products_family
- add_attribute_value
- delete_products_and_product_models

Could not generate test report in gradle due to cucumber step syntax

I get following error message when I tried to run tests in command line.
Tests are based on Geb, Selenium and Cucumber/Groovy.
Caused by: org.gradle.api.GradleException: Could not generate test report to 'D:\Folder\ABCD\Auto\build\reports\tests'.
at org.gradle.api.internal.tasks.testing.junit.report.DefaultTestReport.generateFiles(DefaultTestReport.java:84)
at org.gradle.api.internal.tasks.testing.junit.report.DefaultTestReport.generateReport(DefaultTestReport.java:48)
at org.gradle.api.tasks.testing.Test.executeTests(Test.java:482)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:530)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:513)
Added more error details:
Caused by: java.io.FileNotFoundException: D:\Folder\ABCD\Auto\build\reports\tests\packages\When I enter valid registration details "d2bcons" and "fi rstdtwob" and "lastdtwob" and "d2bcons#trashcanmail.html (The filename, directory name, or volume label syntax is incorrect)
What could cause the error?
Thanks
After doing some investigations it was turned out that this was due to dot (".") use in the Gherkin file for one of the test steps.
The root cause was when try to generate test report with step name as the file name, it generate this error since it is invalid to have dot in the htlm file apart from the extension dot.
Hope this is clear and helpful.
It is possible to provide an argument to Cucumber so that it does not use invalid characters in the filename. On your Cucumber runner class you can add the following argument to the CucumberOptions attribute:
--filename-compatible-names
For example:
#CucumberOptions(junit = {"--filename-compatible-names"})

Resources