Application crashes after I change the mxnet model - java

Problem
I have tried to replace the Mxnet models in WhatsThis with my own Caffe models that I ported to Mxnet with https://github.com/Microsoft/MMdnn . When I run the application, I get a white screen with no elements and the application crashes. Please advise. Assume that the model is correct as it works perfectly on a PC Mxnet environment. I only changed the model, did nothing else to get this behavior.
Solutions that I tried
Change the input shape ( model is set for 1,3,128,128) - problem remains
Files used
symbol.json
Error log
Log (full error log pasted to pastebin due to stack overflow's limits)
06-20 10:27:24.335 3960-3960/? E/Zygote: isWhitelistProcess - Process is Whitelisted
...

Check that the application works using the models provided in the repository, to confirm that Android can use the MXNet library correctly. Use the instructions on how to build the MXNet Amalgamation here if things are not working with the default models.
You could also try some other methods of converting your model. ONNX is supported by MXNet and given you're converting a Caffe model, you should be able to use the MXNet Caffe Converter too.

Related

Android Studio - "URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)" in all of my .gwt.xml files

I'm having a really strange issue. I'm a few days into work on a new android studio project with LibGDX, as a relative beginner to android/android studio/java/LibGDX, and I have just been trying to learn using VCS with GitHub so that I could make changes without worrying about damages.
However when I attempt to commit my project, my commit returns around 100 errors which I believe are all rooted to this:
Error example
This occurs in every .gwt.xml file in my project, all sharing the same link. Also, when I normally compile and run my project, no errors occur at all.
I have already tried searching for similar issues on this topic, all of which have returned with errors that dealt with a different URI (relating to the android APK). The solutions to those don't apply for mine either, as when I attempt to "Fetch external resource" I get the following message:
Error while fetching http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd
Even though I am not using a proxy.
If it helps, this also occurs in my iOS folder, where the link there is:
http://www.apple.com/DTDs/PropertyList-1.0.dtd
DTDs for GWT modules have long moved to gwtproject.org, but the DTDs aren't needed, they're just there to help with autocompletion in editors.
So, you can update the URL, or you can just delete the <! DOCTYPE> lines.

Running A Java Eclipse Project on a Cloud-based Server with external Libraries

I hope this is the right place to post this question. The web applications stack exchange did not look suitable based on the other questions asked on there so I guessed this might be the best place to put this question.
I have a java eclipse project that works as I would like it which takes in an image locally from the adjacent file path and performs the required action on this image before returning a double value at the end after all the calculations. To do these calculations I use the OpenCV library which is essential to the core functionality of the application.
The issue I am having is to deploy this application so that the the application when it receives a request will take in an image (preferably as a .jpg but this can be changed if absolutely essential) and then after the application has carried out the required task send back the resulting number. In future this will be sent and received by an Android app which will just take the photo, compress it and send it away before receiving and displaying the answer but for now I'm just trying to get my project onto an accessible server.
I have tried to use Heroku and followed their tutorials and instructions which encourages the use of Maven but I could not properly insert the dependencies for my project as it used an external jar. I spent a lot of time checking through the various solutions online to this issue but a lot of them felt like workarounds which only worked in some cases and none were working for me. I am open to using this again if there is an elegant solution that is simple to follow.
The main sections of this question that I am asking is for the simplest way to take my working eclipse project which uses an external library, modify it to take in an image via server request and then send back a number result. I also would like a suggestion as to which cloud-based service would be suitable for this project and allow me simply to put my code on their service and allow a test user to run this code whenever I want with reasonable availability.
Sorry for the long-winded explanation and I hope I have provided enough information. I have been trying to work out how to do these things with the help of tutorials and suggestions for a few weeks now but have no previous experience with making a web server as everything I have created has been a local program.
Thanks for your help and suggestions

Native function no implementation found

Problem: 20% of users are receiving:
Fatal Exception: java.lang.UnsatisfiedLinkError
No implementation found for java.lang.String com.example.utils.API.getHashString(android.content.Context) (tried Java_com_example_utils_API_getHashString and Java_com_example_utils_API_getHashString__Landroid_content_Context_2)
For other 80% app working perfectly, no exception on my test devices as well.
Can't figure out what's the problem.
EDIT1:
Library loads perfectly on splash screen. No exception on that point.
static { System.loadLibrary("my-lib"); }
EDIT2:
Just reproduced the error. It is absolutely random. App function call works fine, and at some time it starts failing. The only fix is re-installing the app.
Following my comment and later comments from #stanislav-parkhomenko, I'm reposting it as an answer. Thanks!
My comment:
Where is the static {...} block located? A possible reason for this could be that the code is not executed before some calls.
And later confirmed by himself that this was the cause:
The problem was in library initialization. Splash screen run not always, because of sharing functionality, thats why some times library did not load.
Thanks to Xavier Rubio Jansana for advice, which cured my blindness.
Glad it helped!
This error is caused by method signature mismatch between Java and native library you are loading. It is likely that 20% of users have different version of library file with same name. If it is your own library try giving it relatively unique name and load it from absolute path to reduce chance of name conflict.
It looks like it's trying to load a native library, and there isn't support in Android Gradle for native code yet. You should double-check the docs for your library to confirm; I tried to look it up but it looks like it's a commercial library without publicly accessible docs.
You could just put the .so files into jniLibs folder in src/main. This was introduced in AS 0.7.2
As a sample, see this from #CommonsWare, or see this page for official samples (scroll to the bottom of page)
Yes Still no support for native library in Android gradle.Just I followed simple hack.It works great.Check this

unable to open STS aft regular intervals

I am working on spring tool suite.I am unable to start STS aft regular intervals say in an interval of 0ne week.STS is not getting opened.can anyone please help me to resolve this?
The log file looks like this..
org.eclipse.swt.SWTError: No more handles
No more handles is the issue I've seen on Win platform sometimes. SWT uses native platform widgets and hence every widget created with SWT has an OS/Platform resource backing the widget. On Windows this backend resource is called GDI handle or GDI+ handle. If these resources aren't disposed correctly by Eclipse or any other app on your platform you'll eventually get "no more handles" error.
Fixing this such that you could start STS would be to restart the machine i guess.
You can also try increasing the number of handles in Windows. (There is plenty of posts about that. Here is one: http://weblogs.asp.net/mikedopp/increasing-user-handle-and-gdi-handle-limits)
The real issue however must be an application that doesn't dispose GDI resources. For Eclipse application every SWT widget must be disposed at the end.

Capturing And Sending Video on Java with Jitsi Library

I'm trying to develop a video chat app on java. I found libjitsi, it uses native libraries. There are two example codes which called AVTransmit2 and AVReceive2 (if you want to look: https://jitsi.org/Projects/LibJitsi). But i can't run any of them. I think I don't know how to add native libraries. When i link the native libraries with that:
System.load("the path of the native library")
all of them seems added except one. The one which stops the running with linking error, the one which called AWTrenderer needs links for more libraries. But libjitsi gives me enough libraries for run the code i think. But i still getting linking problem at output. So where is the problem? Can anybody help me please?
Solved. I didn't use system.load for linking the native libraries. My IDE's (eclipse) got a configuration for it. You just selecting the folder which includes native libraries.

Categories

Resources