apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.78k stars 6.79k forks source link

I can't load mxnet package in R (macOS) #14207

Open perax opened 5 years ago

perax commented 5 years ago

Description

I have installed mxnet following the steps on the web: https://mxnet.apache.org/versions/master/install/index.html?platform=MacOS&language=R&processor=CPU

When I try to load mxnet library via library(mxnet) I have the following error:

 .onLoad failed in loadNamespace() for 'mxnet', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so, 10): Library not loaded: /usr/local/opt/opencv/lib/libopencv_stitching.3.4.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so
  Reason: image not found 

I noted that the reason was I haven't got the file libopencv_stitching.3.4.dylib and then I have create manually all the symbolic link needed via

ln -sf /usr/local/opt/opencv/lib/libopencv_bgsegm.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_bgsegm.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_bioinspired.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_bioinspired.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_calib3d.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_calib3d.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_ccalib.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_ccalib.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_core.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_core.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_datasets.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_datasets.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_dnn.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_dnn.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_dnn_objdetect.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_dnn_objdetect.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_dpm.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_dpm.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_face.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_face.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_features2d.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_features2d.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_flann.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_flann.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_fuzzy.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_fuzzy.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_gapi.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_gapi.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_hfs.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_hfs.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_highgui.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_highgui.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_img_hash.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_img_hash.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_imgcodecs.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_imgcodecs.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_imgproc.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_imgproc.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_line_descriptor.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_line_descriptor.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_ml.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_ml.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_objdetect.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_objdetect.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_optflow.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_optflow.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_phase_unwrapping.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_phase_unwrapping.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_photo.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_photo.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_plot.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_plot.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_reg.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_reg.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_rgbd.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_rgbd.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_saliency.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_saliency.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_shape.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_shape.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_stereo.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_stereo.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_stitching.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_stitching.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_structured_light.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_structured_light.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_superres.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_superres.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_surface_matching.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_surface_matching.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_tracking.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_tracking.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_video.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_video.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_videoio.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_videoio.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_videostab.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_videostab.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_xfeatures2d.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_xfeatures2d.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_ximgproc.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_ximgproc.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_xobjdetect.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_xobjdetect.3.4.dylib
ln -sf /usr/local/opt/opencv/lib/libopencv_xphoto.4.0.1.dylib /usr/local/opt/opencv/lib/libopencv_xphoto.3.4.dylib

in a terminal.

Finnally, when I try to load mxnet package I have the error:

Error: package or namespace load failed for ‘mxnet’:
 .onLoad failed in loadNamespace() for 'mxnet', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so, 10): Symbol not found: __ZN2cv5errorEiRKNS_6StringEPKcS4_i
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so
  Expected in: /usr/local/opt/opencv/lib/libopencv_core.3.4.dylib
 in /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mxnet/libs/libmxnet.so

and I don't know what more to do :(

Environment info (Required)


Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS  10.14.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] es_ES.UTF-8/es_ES.UTF-8/es_ES.UTF-8/C/es_ES.UTF-8/es_ES.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1    yaml_2.2.0 
mxnet-label-bot commented 5 years ago

Hey, this is the MXNet Label Bot. Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it. Here are my recommended labels: Installation

lanking520 commented 5 years ago

@anirudhacharya could you please take a look