Coder Social home page Coder Social logo

Invalid Mex file about caffe HOT 7 CLOSED

microsoft avatar microsoft commented on July 19, 2024
Invalid Mex file

from caffe.

Comments (7)

mnidza avatar mnidza commented on July 19, 2024

Looks like MATLAB cannot fine the matcaffe package that you built. Make sure that <caffe_root>\Build\x64\Release\matcaffe\+caffe\private\caffe_.mexw64 exists, and that your MATLAB and system search paths are set correctly (instructions). Also, what is your MATLAB working dir when you try to execute classification_demo?

from caffe.

Socierducode avatar Socierducode commented on July 19, 2024

@mnidza Thank you very much for your answers
In fact I tried to execute it under the path <caffe_root>\matlab, but it didn't work because I can't find the caffe_.mexw64 inside, so I had a following plan:
1, copy the demo file under the release path, the invalid file problem came.
2, copy the caffe_.mexw64 under the <caffe_root>\matlab+caffe\private, the same problem
<caffe_root>\Build\x64\Release\matcaffe and <caffe_root>\windows\matcaffe are both added in my matlab path
<caffe_root>\Build\x64\Release\ is added in the system path as well
The caffe_.mexw64 did exist in the release file
Looking forward to your answers
Thank you very much

from caffe.

mnidza avatar mnidza commented on July 19, 2024

@Socierducode All copying should be done automatically by build scripts, you should not have to do any yourself.

I'm guessing that since you tried to run the demo from <caffe_root>\matlab, MATLAB incorrectly picked up <caffe_root>\matlab\+caffe (which does not contain the MEX) instead of <caffe_root>\Build\x64\Release\matcaffe\+caffe. Even if that's the case, it is still strange that your solution 2 did not solve the problem.

Can you try to delete your current <caffe_root>\Build folder, rebuild everything, modify search paths exactly according to instructions (without adding any additional paths or copying any files), and try to run the demo from some folder other than <caffe_root>\matlab?

from caffe.

Socierducode avatar Socierducode commented on July 19, 2024

@mnidza Thank you for your answers, I delected all the past files and tried to rebuild your latest scripts, but VS cannot open the libcaffe.lib, should I add some links? I cannot find such a file. Thanks

from caffe.

mnidza avatar mnidza commented on July 19, 2024

@Socierducode libcaffe.lib is created by building the libcaffe project. You should rebuild the whole solution, not only one project (e.g. matcaffe). That way you ensure that all dependencies for building the MEX, including libcaffe.lib, are built.

from caffe.

Socierducode avatar Socierducode commented on July 19, 2024

@mnidza Thank you very much for your responses, I succeed to build the lastest caffe script, and Matlab folder does contain the caffe_.mexw64 this time, but it doesn't solve the problem, it changes like invalid Mex-file '<caffe_root>\Build\x64\Release\matcaffe+caffe\private\caffe_.mexw64' : The specified module couldn't be found. So I tried a solution to avoid the system path problem, I copied all the non- folder files in the private folder, it doesn't solve the problem. I search the answers on the Internet, it may have 2 sorts of problems:1, we lose some dll files; 2, the runtime library is imcompactible to the compile time library, but I have no idea how to solve this problem
Looking forward to your answers
Thank you

from caffe.

mnidza avatar mnidza commented on July 19, 2024

@Socierducode Again, you should not have to copy any files after the build is done. It is more likely that you're dealing with problem 1, so we can try to debug under that assumption first. For that it would be really useful to go back to state after a clean build, that is

Can you try to delete your current <caffe_root>\Build folder, rebuild everything, modify search paths exactly according to instructions (without adding any additional paths or copying any files), and try to run the demo from some folder other than <caffe_root>\matlab ?

After that, open MATLAB command window, go to the folder from which you normally execute classification_demo (which should be different from <caffe_root>\matlab), issue the following four commands:

  • version
  • pwd
  • path
  • getenv('PATH')

and post back their outputs.

from caffe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.