Hi Atita,

Yes, I think it is an issue with the M1 Mac. Looking at onnxruntime it says
it supports Windows x64, Linux x64, macOS x64. (
https://onnxruntime.ai/docs/get-started/with-java.html)

Thanks,
Jeff


On Fri, Feb 17, 2023 at 4:47 PM Atita Arora <atitaar...@gmail.com> wrote:

> Hi,
>
> Thank you Jeff for sharing the Eval-test-data and Thanks for sharing the mv
> Richard.
> Those are my results :
>
> [INFO] -------------------------------------------------------
> [INFO]  T E S T S
> [INFO] -------------------------------------------------------
> [INFO] Running
> opennlp.dl.doccat.scoring.AverageClassificationScoringStrategyTest
> [INFO] Running opennlp.dl.namefinder.NameFinderDLEval
> [INFO] Running opennlp.dl.doccat.DocumentCategorizerDLEval
> [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
> 0.016 s - in
> opennlp.dl.doccat.scoring.AverageClassificationScoringStrategyTest
> [ERROR] Tests run: 6, Failures: 0, Errors: 5, Skipped: 1, Time elapsed:
> 0.034 s <<< FAILURE! - in opennlp.dl.doccat.DocumentCategorizerDLEval
> [ERROR] doccat  Time elapsed: 0.021 s  <<< ERROR!
> java.lang.UnsatisfiedLinkError: no onnxruntime in java.library.path:
>
> /Users/atitaarora/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
>         at
>
> opennlp.dl.doccat.DocumentCategorizerDLEval.doccat(DocumentCategorizerDLEval.java:213)
>
> [ERROR] scoreMap  Time elapsed: 0.001 s  <<< ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.doccat.DocumentCategorizerDLEval.scoreMap(DocumentCategorizerDLEval.java:167)
>
> [ERROR] categorizeWithInferenceOptions  Time elapsed: 0.001 s  <<< ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.doccat.DocumentCategorizerDLEval.categorizeWithInferenceOptions(DocumentCategorizerDLEval.java:141)
>
> [ERROR] sortedScoreMap  Time elapsed: 0 s  <<< ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.doccat.DocumentCategorizerDLEval.sortedScoreMap(DocumentCategorizerDLEval.java:190)
>
> [ERROR] categorize  Time elapsed: 0.001 s  <<< ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.doccat.DocumentCategorizerDLEval.categorize(DocumentCategorizerDLEval.java:48)
>
> [ERROR] Tests run: 7, Failures: 1, Errors: 6, Skipped: 0, Time elapsed:
> 1.088 s <<< FAILURE! - in opennlp.dl.namefinder.NameFinderDLEval
> [ERROR] tokenNameFinderNoEntitiesTest  Time elapsed: 0.017 s  <<< ERROR!
> java.lang.UnsatisfiedLinkError: no onnxruntime in java.library.path:
>
> /Users/atitaarora/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
>         at
>
> opennlp.dl.namefinder.NameFinderDLEval.tokenNameFinderNoEntitiesTest(NameFinderDLEval.java:146)
>
> [ERROR] invalidModel  Time elapsed: 0.003 s  <<< FAILURE!
> org.opentest4j.AssertionFailedError: Unexpected exception type thrown,
> expected: <ai.onnxruntime.OrtException> but was:
> <java.lang.NoClassDefFoundError>
>         at
>
> opennlp.dl.namefinder.NameFinderDLEval.invalidModel(NameFinderDLEval.java:183)
> Caused by: java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.namefinder.NameFinderDLEval.lambda$invalidModel$0(NameFinderDLEval.java:190)
>         at
>
> opennlp.dl.namefinder.NameFinderDLEval.invalidModel(NameFinderDLEval.java:183)
>
> [ERROR] tokenNameFinderNoInputTest  Time elapsed: 0.001 s  <<< ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.namefinder.NameFinderDLEval.tokenNameFinderNoInputTest(NameFinderDLEval.java:128)
>
> [ERROR] tokenNameFinder1Test  Time elapsed: 0 s  <<< ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.namefinder.NameFinderDLEval.tokenNameFinder1Test(NameFinderDLEval.java:54)
>
> [ERROR] tokenNameFinder2Test  Time elapsed: 0 s  <<< ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.namefinder.NameFinderDLEval.tokenNameFinder2Test(NameFinderDLEval.java:80)
>
> [ERROR] tokenNameFinder3Test  Time elapsed: 0 s  <<< ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.namefinder.NameFinderDLEval.tokenNameFinder3Test(NameFinderDLEval.java:104)
>
> [ERROR] tokenNameFinderMultipleEntitiesTest  Time elapsed: 0 s  <<< ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> ai.onnxruntime.OrtEnvironment
>         at
>
> opennlp.dl.namefinder.NameFinderDLEval.tokenNameFinderMultipleEntitiesTest(NameFinderDLEval.java:165)
>
> [INFO]
> [INFO] Results:
> [INFO]
> [ERROR] Failures:
> [ERROR]   NameFinderDLEval.invalidModel:183 Unexpected exception type
> thrown, expected: <ai.onnxruntime.OrtException> but was:
> <java.lang.NoClassDefFoundError>
> [ERROR] Errors:
> [ERROR]   DocumentCategorizerDLEval.categorize:48 ? NoClassDefFound Could
> not initialize...
> [ERROR]   DocumentCategorizerDLEval.categorizeWithInferenceOptions:141 ?
> NoClassDefFound
> [ERROR]   DocumentCategorizerDLEval.doccat:213 ? UnsatisfiedLink no
> onnxruntime in java....
> [ERROR]   DocumentCategorizerDLEval.scoreMap:167 ? NoClassDefFound Could
> not initialize ...
> [ERROR]   DocumentCategorizerDLEval.sortedScoreMap:190 ? NoClassDefFound
> Could not initi...
> [ERROR]   NameFinderDLEval.tokenNameFinder1Test:54 ? NoClassDefFound Could
> not initializ...
> [ERROR]   NameFinderDLEval.tokenNameFinder2Test:80 ? NoClassDefFound Could
> not initializ...
> [ERROR]   NameFinderDLEval.tokenNameFinder3Test:104 ? NoClassDefFound Could
> not initiali...
> [ERROR]   NameFinderDLEval.tokenNameFinderMultipleEntitiesTest:165 ?
> NoClassDefFound Cou...
> [ERROR]   NameFinderDLEval.tokenNameFinderNoEntitiesTest:146 ?
> UnsatisfiedLink no onnxru...
> [ERROR]   NameFinderDLEval.tokenNameFinderNoInputTest:128 ? NoClassDefFound
> Could not in...
> [INFO]
> [ERROR] Tests run: 15, Failures: 1, Errors: 11, Skipped: 1
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary for Apache OpenNLP Reactor 2.1.1-SNAPSHOT:
> [INFO]
> [INFO] Apache OpenNLP Reactor ............................. SUCCESS [
>  0.864 s]
> [INFO] Apache OpenNLP Tools ............................... SUCCESS [
>  02:06 h]
> [INFO] Apache OpenNLP UIMA Annotators ..................... SUCCESS [
>  1.550 s]
> [INFO] Apache OpenNLP Brat Annotator ...................... SUCCESS [
>  0.256 s]
> [INFO] Apache OpenNLP Morfologik Addon .................... SUCCESS [
>  1.271 s]
> [INFO] Apache OpenNLP Documentation ....................... SUCCESS [
>  0.048 s]
> [INFO] Apache OpenNLP Distribution ........................ SUCCESS [
> 42.403 s]
> [INFO] Apache OpenNLP DL .................................. FAILURE [
>  1.876 s]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time:  02:07 h
> [INFO] Finished at: 2023-02-17T20:42:02+01:00
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test)
> on project opennlp-dl: There are test failures.
> [ERROR] After correcting the problems, you can resume the build with the
> command
> [ERROR]   mvn <args> -rf :opennlp-dl
> (base) atitaarora@Atitas-MacBook-Pro opennlp % git pull
> Already up to date.
>
> I haven't researched but at first glance at 10.45 pm feels like some issue
> with onnx runtime on my Apple M1 Mac.
>
> Any suggestions?
>
> Thanks
>
> Best,
> Atita
>

Reply via email to