Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

opencv path error in mxnet scala tutorial #12416

Closed
jesterhazy opened this issue Aug 30, 2018 · 9 comments
Closed

opencv path error in mxnet scala tutorial #12416

jesterhazy opened this issue Aug 30, 2018 · 9 comments

Comments

@jesterhazy
Copy link
Contributor

jesterhazy commented Aug 30, 2018

Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.

For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io

Description

The mxnet scala in intellij instructions at http://mxnet.incubator.apache.org/tutorials/scala/mxnet_scala_on_intellij.html do not work because of an opencv library path error.

Package used (Python/R/Scala/Julia):
mxnet-scala

For Scala user, please provide:
1. Java version: 1.8.0_171
2. Maven version:  3.3.9 
3. Scala runtime if applicable: 2.11.8

Error Message:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /private/var/folders/nz/57cdgtr11pdg01rgzyzhjxvmqwmxjn/T/mxnet4117240061172168094/mxnet-scala: dlopen(/private/var/folders/nz/57cdgtr11pdg01rgzyzhjxvmqwmxjn/T/mxnet4117240061172168094/mxnet-scala, 1): Library not loaded: /usr/local/opt/opencv/lib/libopencv_stitching.3.4.dylib
  Referenced from: /private/var/folders/nz/57cdgtr11pdg01rgzyzhjxvmqwmxjn/T/mxnet4117240061172168094/mxnet-scala
  Reason: image not found
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at org.apache.mxnet.util.NativeLibraryLoader$.loadLibraryFromStream(NativeLibraryLoader.scala:140)
    at org.apache.mxnet.util.NativeLibraryLoader$.loadLibrary(NativeLibraryLoader.scala:93)
    at org.apache.mxnet.Base$.<init>(Base.scala:70)
    at org.apache.mxnet.Base$.<clinit>(Base.scala)
    at org.apache.mxnet.NDArray$.initNDArrayModule(NDArray.scala:151)
    at org.apache.mxnet.NDArray$.<init>(NDArray.scala:38)
    at org.apache.mxnet.NDArray$.<clinit>(NDArray.scala)
    at mxnet.App$.delayedEndpoint$mxnet$App$1(App.scala:9)
    at mxnet.App$delayedInit$body.apply(App.scala:6)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.App$$anonfun$main$1.apply(App.scala:76)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
    at scala.App$class.main(App.scala:76)
    at mxnet.App$.main(App.scala:6)
    at mxnet.App.main(App.scala)

Steps to reproduce

  1. Follow tutorial to "Step 7. Run Sample MXNet Code in the App" and run the app
  2. App fails with stack trace shown above.

What have you tried to solve it?

  1. Replacing the brew install opencv@2 command in the mac prequisite setup section with brew install opencv fixes the problem and lets the example app run successfully. So either the example doc needs to be revised to use the other opencv version, or mxnet scala needs to look for different lib path.
@jesterhazy
Copy link
Contributor Author

@aaronmarkham @lanking520

@anirudhacharya
Copy link
Member

@mxnet-label-bot [Scala, Example]

@lanking520
Copy link
Member

@jesterhazy in 1.2.0 we used opencv@2, 1.2.1 we used opencv (version 3)

@lanking520
Copy link
Member

Hi @jesterhazy did this solve your problem?

@jesterhazy
Copy link
Contributor Author

@lanking520 i figured out the workaround before i opened the ticket (as noted in the ticket). the problem is that the instructions are wrong.

@lanking520
Copy link
Member

@jesterhazy thank you. @aaronmarkham can you pick up from here and update the installation instruction for Scala user?

@zachgk
Copy link
Contributor

zachgk commented Nov 9, 2018

This issue can be closed as it was resolved in #12654

@zachgk
Copy link
Contributor

zachgk commented Dec 3, 2018

@lanking520 We can close this issue because the fix was applied in #12654

@lanking520
Copy link
Member

lanking520 commented Jan 12, 2019

@jesterhazy Let's close this issue for now since all of our new releases are static-linked. We no longer require user to install OpenCV in the system. Please feel free to reopen if you still find this problems in our releases

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants