Caffe_ undefine in Matlab on Win10

398 views
Skip to first unread message

Dewey

unread,
Apr 27, 2017, 12:16:52 PM4/27/17
to Caffe Users
Hi,

I've build the Windows Branch of Caffe on my Windows 10 machine with Matlab R2015b. I only built Matlab since I'll need it just for training.
$ ./scripts/build_win.cmd
Das System kann das angegebene Laufwerk nicht finden.
Das System kann das angegebene Laufwerk nicht finden.
INFO: ============================================================
INFO: Summary:
INFO: ============================================================
INFO: MSVC_VERSION               = 14
INFO: WITH_NINJA                 = 0
INFO: CMAKE_GENERATOR            = "Visual Studio 14 2015 Win64"
INFO: CPU_ONLY                   = 0
INFO: CUDA_ARCH_NAME             = Auto
INFO: CMAKE_CONFIG               = Release
INFO: USE_NCCL                   = 0
INFO: CMAKE_BUILD_SHARED_LIBS    = 0
INFO: PYTHON_VERSION             = 2
INFO: BUILD_PYTHON               = 0
INFO: BUILD_PYTHON_LAYER         = 0
INFO: BUILD_MATLAB               = 1
INFO: PYTHON_EXE                 = "python"
INFO: RUN_TESTS                  = 1
INFO: RUN_LINT                   = 0
INFO: RUN_INSTALL                = 1
INFO: ============================================================
-- Building without python. Prebuilt dependencies will default to Python 2.7
-- Boost version: 1.61.0
...

The build, test and install works without problem, I get some warnings, but no errors as far as I can see.

Now if i try to run `caffe.run_tests()` in Matlab from C:\Projects\caffe\matlab, I get the following error:
>> caffe.run_tests()
Undefined function or variable 'caffe_'.

Error in caffe.set_mode_cpu (line 5)
caffe_('set_mode_cpu');

Error in caffe.run_tests (line 6)
caffe.set_mode_cpu();

I was wondering why my mex file is in C:\Projects\caffe\matlab\+caffe\private\Release\caffe_.mexw64

I've already added the following paths to Matlab
C:\Projects\caffe\include
C:\Projects\caffe\matlab

Has anyone an idea how I get caffe_ into matlab.

Thanks for your help, let me know if you need more information.

Here the full config:
-- OpenCV found (C:/Users/Thomas/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries)
-- Found OpenBLAS libraries: C:/Users/Thomas/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/lib/libopenblas.dll.a
-- Found OpenBLAS include: C:/Users/Thomas/.caffe/dependencies/libraries_v140_x64_py27_1.1.0/libraries/include
-- Python interface is disabled or not all required dependencies found. Building without it...
--
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   1.0.0-rc5
--   Git               :   rc5-110-g37ff78a-dirty
--   System            :   Windows
--   C++ compiler      :   C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
--   Release CXX flags :   /MD /O2 /Ob2 /D NDEBUG /DWIN32 /D_WINDOWS /W3 /GR /EHsc
--   Debug CXX flags   :   /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 /DWIN32 /D_WINDOWS /W3 /GR /EHsc
--   Build type        :   Release
--
--   BUILD_SHARED_LIBS :   0
--   BUILD_python      :   0
--   BUILD_matlab      :   1
--   BUILD_docs        :
--   CPU_ONLY          :   0
--   USE_OPENCV        :   ON
--   USE_LEVELDB       :   ON
--   USE_LMDB          :   ON
--   USE_NCCL          :   0
--   ALLOW_LMDB_NOLOCK :   OFF
--
-- Dependencies:
--   BLAS              :   Yes (Open)
--   Boost             :   Yes (ver. 1.61)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 3.1.0)
--   lmdb              :   Yes (ver. 0.9.70)
--   LevelDB           :   Yes (ver. 1.18)
--   Snappy            :   Yes (ver. 1.1.1)
--   OpenCV            :   Yes (ver. 3.1.0)
--   CUDA              :   No
--
-- Matlab:
--   Matlab            :   Yes (,
--   Octave            :   No
--
-- Install:
--   Install path      :   C:/Projects/caffe/build/install
--
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Projects/caffe/build
Microsoft (R)-Buildmodul, Version 14.0.25420.1




rashika mishra

unread,
Apr 27, 2017, 7:12:56 PM4/27/17
to Caffe Users
Hi I am having the same error. I tried adding the folder in which mex64 is present to the path but as it contains a '+' symbol I was unable to so. Copying the file to caffe/build/matlab/release resulted in a new error
 Invalid MEX-file 'C:\Users\..\..\..\..\caffe\build\Matlab\Release\caffe_.mexw64': The specified module
could not be found..

Were you able to solve the issue?

Snarcraft Utiha

unread,
May 26, 2017, 5:36:00 AM5/26/17
to Caffe Users
copy caffe\matlab\+caffe\private\Release\caffe_.mexw64 file  and paste into caffe\matlab\+caffe\private\
Reply all
Reply to author
Forward
0 new messages