Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Backwards Compatible FileSplit #6457

BarendHarris opened this issue Sep 18, 2018 · 3 comments · Fixed by #6470


Copy link

commented Sep 18, 2018

I am trying to develop an application that can train using images on an android phone, however the device has API level 22. The FileSplit implementation uses the .toPath() method and Path Object that was only introduced in Android API 26, so when creating a FileSplit the following error occurs. (At least I believe that to be the cause).

java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(
        at java.util.concurrent.FutureTask.finishCompletion(
        at java.util.concurrent.FutureTask.setException(
        at android.os.AsyncTask$SerialExecutor$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$
Caused by: java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of '' appears in /system/framework/core-libart.jar)
        at org.datavec.api.split.FileSplit.initialize(
        at org.datavec.api.split.FileSplit.<init>(
        at org.datavec.api.split.FileSplit.<init>(

Would it possible to create an implementation of FileSplit that is backwards compatible with versions of Android < 26? If not, how would I go about creating an implementation that does support this?



This comment has been minimized.

Copy link

commented Sep 18, 2018

In principle, sure - I think the only place this method is used is for recursively listing of files here:

Changing this should be relatively straightforward - feel free to send us a pull request with a fix - or I'll try to take a look later in the week.


This comment has been minimized.

Copy link

commented Sep 19, 2018

Thanks Alex,

I'm not sure I'd be able to fix this myself, so I would really appreciate it if you could take a look please.

AlexDBlack added a commit that referenced this issue Sep 20, 2018
AlexDBlack added a commit that referenced this issue Sep 23, 2018
DL4J/ND4J Misc fixes (#6470)
* #6431 SimpleRNN respect biasInit config value

* #6457 FileSplit android compatibility

* #6451 Improve preconditions class

* Fix pad op mapping

* #6471 Check for OutputLayer as first step in MultiLayerNetwork.computeGradientAndScore()

* Fix Reverse op mapping; map HistogramFixedWidth

* Fix HistogramfixedWidth mapping

* Fix DeConv2DTF op import mapping

* Fix unsorted op mapping

* HistogramFixedWidth fix; map DynamicPartitionBp

* Conv3d and OneHot test fixes

* More test fixes/re-enabling

* Restore ReverseV2 op

* Test tweaks

This comment has been minimized.

Copy link

commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Oct 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
3 participants
You can’t perform that action at this time.