BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.04k stars 18.7k forks source link

matcaffe Gateway function is missing #6694

Open spstrademark opened 5 years ago

spstrademark commented 5 years ago

Hello,

I am trying to use the MATLAB interface under windows 10, i am building caffe the following way:

C:\Projects> git clone https://github.com/BVLC/caffe.git C:\Projects> cd caffe C:\Projects\caffe> git checkout windows :: Edit any of the options inside build_win.cmd to suit your needs

Here in scripts\build_win.cmd i make the following changes:

if NOT DEFINED BUILD_PYTHON set BUILD_PYTHON=0
if NOT DEFINED BUILD_MATLAB set BUILD_MATLAB=1

and if NOT DEFINED BUILD_PYTHON set BUILD_PYTHON=0 if NOT DEFINED BUILD_MATLAB set BUILD_MATLAB=1

after that i run the script using the following way C:\Projects\caffe> scripts\build_win.cmd

It compiles successfully!

After that i am running MATLAB R2018b i direct to the following working directory : PC_dir\caffe\matlab

And when i try to run caffe.set_mode_cpu(); i get the following message :

Invalid MEX-file 'PCdir\caffe\matlab+caffe\private\caffe.mexw64': Gateway function is missing.

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

Note that " PC_dir " is the directory to caffe

In caffe\cmake\Modules i tried editing " FindMatlabMex.cmake " by adding " 9.5 in " if(MSVC) " as follow: foreach(__ver "9.5" "7.14" "7.11" "7.10" "7.9" "7.8" "7.7")

but that did not work.

Can someone help me please? Best regards.

Sureshthommandru commented 5 years ago

Hi Dear, Did you get the solution?

spstrademark commented 5 years ago

Hello, Yes try moving the content of caffe\matlab+caffe\private to caffe\matlab

Best regards, Stanko Stankov

Sureshthommandru commented 5 years ago

Hello, Thanks for your response. But same error I am getting even, after copying the files of caffe\matlab+caffe\private to caffe\matlab.

Best regards, Suresh Tommandru

On Fri, Mar 22, 2019 at 9:16 PM spstrademark notifications@github.com wrote:

Hello, Yes try moving the content of caffe\matlab+caffe\private to caffe\matlab

Best regards, Stanko Stankov

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/6694#issuecomment-475671533, or mute the thread https://github.com/notifications/unsubscribe-auth/AtoRzFLjUYwZrKTCG82u11ZMA_dbatmmks5vZPrLgaJpZM4bGj14 .

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705

spstrademark commented 5 years ago

Hello,

I am not sure i could send you my build as zip if you want.

Best regards, Stanko Stankov

Sureshthommandru commented 5 years ago

Hello Dear, PyCaffe working but only for Matcaffe.

Yes please, if you are to send the build file.

Thank you

On Sat, Mar 23, 2019 at 4:51 PM spstrademark notifications@github.com wrote:

Hello,

I am not sure i could send you my build as zip if you want.

Best regards, Stanko Stankov

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/6694#issuecomment-475861472, or mute the thread https://github.com/notifications/unsubscribe-auth/AtoRzBle9CyzAxI57sMaxTXW5NmMuq4Jks5vZg5DgaJpZM4bGj14 .

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705

spstrademark commented 5 years ago

Hello Sureshthommandru,

I uploaded the files here, there are a few extra ones from the things i tried after building the caffe, Feel free to experiment and let me know if you have any other questions,

Try to download them from here - https://drive.google.com/open?id=1BXZPVEVK7L2BP6SMdPg7uZ1X4l1AVZ9n

Best regards, Stanko Stankov

Sureshthommandru commented 5 years ago

Thank you Dear,

I will try with this.

On Tue, Mar 26, 2019 at 10:43 AM spstrademark notifications@github.com wrote:

Hello Sureshthommandru,

I uploaded the files here, there are a few extra ones from the things i tried after building the caffe, Feel free to experiment and let me know if you have any other questions,

Try to download them from here - https://drive.google.com/open?id=1BXZPVEVK7L2BP6SMdPg7uZ1X4l1AVZ9n

Best regards, Stanko Stankov

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/6694#issuecomment-476478129, or mute the thread https://github.com/notifications/unsubscribe-auth/AtoRzIxfLCC5b2gWPTsAI3uRtfbKXCRbks5vaaxvgaJpZM4bGj14 .

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705

Sureshthommandru commented 5 years ago

Thank you Dear,

Your caffe folder worked in my system. I ran the caffe.run_tests(), it shows as below

caffe.run_tests() Cleared 0 solvers and 0 stand-alone nets Running caffe.test.test_net ..... Done caffe.test.test_net


Warning: The following error was caught while executing 'caffe.Solver' class destructor: Error using caffeUsage: caffe('deletesolver', hSolver) Error in caffe.Solver/delete (line 40) caffe('delete_solver', self.hSolver_self); Error in caffe.Solver (line 21) self = caffe.get_solver(varargin{:}); Error in caffe.test.test_solver (line 22) self.solver = caffe.Solver(solver_file); Error in caffe.run_tests (line 14) run(caffe.test.test_solver) ... In caffe.Solver (line 21) In caffe.test.test_solver (line 22) In caffe.run_tests (line 14) Running caffe.test.test_solver . Done caffe.test.test_solver


Running caffe.test.test_io . Done caffe.test.test_io


Cleared 1 solvers and 1 stand-alone nets

      ans =   1×7 TestResult array with properties:
                  Name
                  Passed
                  Failed
                  Incomplete
                  Duration
                  Details

       Totals:
                  7 Passed, 0 Failed, 0 Incomplete.
                  55.8529 seconds testing time.

It took this much of time due to my system problem. even though I am using, Intel Xeon(R) CPU E5-2680 @ 2.70GHz 2.70GHz (2 processor) RAM - 32GB Windows 10 - 64 bit OS. TITAN X GPU with 12GB internal memory.

Once again Thank you Dear.

On Tue, Mar 26, 2019 at 10:50 AM suresh thommandru < sureshthommandru007@gmail.com> wrote:

Thank you Dear,

I will try with this.

On Tue, Mar 26, 2019 at 10:43 AM spstrademark notifications@github.com wrote:

Hello Sureshthommandru,

I uploaded the files here, there are a few extra ones from the things i tried after building the caffe, Feel free to experiment and let me know if you have any other questions,

Try to download them from here - https://drive.google.com/open?id=1BXZPVEVK7L2BP6SMdPg7uZ1X4l1AVZ9n

Best regards, Stanko Stankov

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/6694#issuecomment-476478129, or mute the thread https://github.com/notifications/unsubscribe-auth/AtoRzIxfLCC5b2gWPTsAI3uRtfbKXCRbks5vaaxvgaJpZM4bGj14 .

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705

Sureshthommandru commented 5 years ago

Hello Dear,

When I executed the commands

im = imread('../../examples/images/cat.jpg');
scores = classification_demo(im, 1);

in caffe\matlab\demo\classification_demo.m.
Matlab error, crashed and closing the Matlab.
Attached the error image.

Thanks for your concern.

On Tue, Mar 26, 2019 at 11:38 AM suresh thommandru < sureshthommandru007@gmail.com> wrote:

Thank you Dear,

Your caffe folder worked in my system. I ran the caffe.run_tests(), it shows as below

caffe.run_tests() Cleared 0 solvers and 0 stand-alone nets Running caffe.test.test_net ..... Done caffe.test.test_net


Warning: The following error was caught while executing 'caffe.Solver' class destructor: Error using caffeUsage: caffe('deletesolver', hSolver) Error in caffe.Solver/delete (line 40) caffe('delete_solver', self.hSolver_self); Error in caffe.Solver (line 21) self = caffe.get_solver(varargin{:}); Error in caffe.test.test_solver (line 22) self.solver = caffe.Solver(solver_file); Error in caffe.run_tests (line 14) run(caffe.test.test_solver) ... In caffe.Solver (line 21) In caffe.test.test_solver (line 22) In caffe.run_tests (line 14) Running caffe.test.test_solver . Done caffe.test.test_solver


Running caffe.test.test_io . Done caffe.test.test_io


Cleared 1 solvers and 1 stand-alone nets

      ans =   1×7 TestResult array with properties:
                  Name
                  Passed
                  Failed
                  Incomplete
                  Duration
                  Details

       Totals:
                  7 Passed, 0 Failed, 0 Incomplete.
                  55.8529 seconds testing time.

It took this much of time due to my system problem. even though I am using, Intel Xeon(R) CPU E5-2680 @ 2.70GHz 2.70GHz (2 processor) RAM - 32GB Windows 10 - 64 bit OS. TITAN X GPU with 12GB internal memory.

Once again Thank you Dear.

On Tue, Mar 26, 2019 at 10:50 AM suresh thommandru < sureshthommandru007@gmail.com> wrote:

Thank you Dear,

I will try with this.

On Tue, Mar 26, 2019 at 10:43 AM spstrademark notifications@github.com wrote:

Hello Sureshthommandru,

I uploaded the files here, there are a few extra ones from the things i tried after building the caffe, Feel free to experiment and let me know if you have any other questions,

Try to download them from here - https://drive.google.com/open?id=1BXZPVEVK7L2BP6SMdPg7uZ1X4l1AVZ9n

Best regards, Stanko Stankov

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/6694#issuecomment-476478129, or mute the thread https://github.com/notifications/unsubscribe-auth/AtoRzIxfLCC5b2gWPTsAI3uRtfbKXCRbks5vaaxvgaJpZM4bGj14 .

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705

spstrademark commented 5 years ago

Hello,

Try setting the classification demo the following way - scores = classification_demo(im, 0);

0 - for CPU 1 - for GPU

I have never tried it on GPU

Best regards, Stanko Stankov

Sureshthommandru commented 5 years ago

Hello Dear,

scores = classification_demo(im, 0);
              Elapsed time is 2.005958 seconds.
              Elapsed time is 6.869061 seconds.
              Cleared 0 solvers and 1 stand-alone nets
              Warning: The following error was caught while executing

'caffe.Net' class destructor: Error using caffe_ Could not convert handle to pointer due to invalid init_key. The object might have been cleared.

              Error in caffe.Net/delete (line 73)

caffe_('delete_net', self.hNet_self);

              Error in classification_demo (line 59)       if

exist('../+caffe', 'dir')

In classification_demo (line 59)

 It was worked for CPU. If we want to train our own data then we have

to go for GPU.

 Is that caffe - working on GPU?

Thanks in advance. Regards

On Tue, Mar 26, 2019 at 1:32 PM spstrademark notifications@github.com wrote:

Hello,

Try setting the classification demo the following way - scores = classification_demo(im, 0);

0 - for CPU 1 - for GPU

I have never tried it on GPU

Best regards, Stanko Stankov

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/6694#issuecomment-476514664, or mute the thread https://github.com/notifications/unsubscribe-auth/AtoRzNmUmwKXIBdJKKpv6XpuBMC94jy5ks5vadQYgaJpZM4bGj14 .

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705

spstrademark commented 5 years ago

Hello,

It should work on GPU, personally i haven't tried it but maybe you can look up in this project and check if you can find something useful - https://github.com/doonny/PipeCNN

Best regards, Stanko Stankov

Sureshthommandru commented 5 years ago

Hello Dear,

I tried on GPU system but showed the error as MATLAB crash and closing the application. I will try with the above link provided by you.

Thank you

On Wed, Mar 27, 2019 at 6:04 PM spstrademark notifications@github.com wrote:

Hello,

It should work on GPU, personally i haven't tried it but maybe you can look up in this project and check if you can find something useful - https://github.com/doonny/PipeCNN

Best regards, Stanko Stankov

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/6694#issuecomment-477131390, or mute the thread https://github.com/notifications/unsubscribe-auth/AtoRzMMnZkzjYRyjtzbbqSP5lwpCO8I-ks5va2VYgaJpZM4bGj14 .

-- Suresh Thommandru Research Scholar Department of Computer Applications National Institute of Technology, Tiruchirappalli - 620015, Tamilnadu, INDIA. Call: 91-9392714705