GithubHelp home page GithubHelp logo

Comments (6)

ereator avatar ereator commented on June 9, 2024

Probably the source of the error is that you use original DGM CMakeLists.txt file to set up your project, which is not really a "correct" way to do so.
Could you please try using the sample CMakeLists.txt file from "Using DGM library with CMake" to set up your project with DGM?

from dgm.

aliyasineser avatar aliyasineser commented on June 9, 2024

Actually the Cmake I attached is for show how I build the DGM. With the link you sent, I made a basic project and tried to build it. Still I got the same error. The error is again:
[ 50%] Building CXX object CMakeFiles/PROJECT_NAME.dir/main.cpp.o In file included from /usr/local/include/DGM.h:43:0, from /home/aliyasineser/Desktop/example/main.cpp:8: /usr/local/include/DGM/GraphDense.h:6:10: fatal error: densecrf/edgePotentialPotts.h: No such file or directory #include "densecrf/edgePotentialPotts.h" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. CMakeFiles/PROJECT_NAME.dir/build.make:62: recipe for target 'CMakeFiles/PROJECT_NAME.dir/main.cpp.o' failed make[2]: *** [CMakeFiles/PROJECT_NAME.dir/main.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/PROJECT_NAME.dir/all' failed make[1]: *** [CMakeFiles/PROJECT_NAME.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

And I attached the program. I didn't change anything with cmake, just the source name, dgm and opencv version.
example.zip

from dgm.

ereator avatar ereator commented on June 9, 2024

@aliyasineser Thank you very much for committing this issue - it was a bug in the library.
Please pull the latest version, now the bug is ought to be fixed.

from dgm.

aliyasineser avatar aliyasineser commented on June 9, 2024

@ereator thank you. I tried to build library but this time I got the error:
/home/aliyasineser/DGM/modules/DGM/TrainNode.cpp: In member function ‘cv::Mat DirectGraphicalModels::CTrainNode::getNodePotentials(const cv::Mat&, const cv::Mat&, float) const’: /home/aliyasineser/DGM/modules/DGM/TrainNode.cpp:46:10: error: ‘word DirectGraphicalModels::ITrain::m_nFeatures’ is private within this context Mat vec(m_nFeatures, 1, CV_8UC1); ^~~~~~~~~~~ In file included from /home/aliyasineser/DGM/modules/DGM/TrainNode.h:5:0, from /home/aliyasineser/DGM/modules/DGM/TrainNode.cpp:1: /home/aliyasineser/DGM/modules/DGM/ITrain.h:41:8: note: declared private here word m_nFeatures; ///< The number of features (length of the feature vector) ^~~~~~~~~~~ /home/aliyasineser/DGM/modules/DGM/TrainNode.cpp: In member function ‘cv::Mat DirectGraphicalModels::CTrainNode::getNodePotentials(const vec_mat_t&, const cv::Mat&, float) const’: /home/aliyasineser/DGM/modules/DGM/TrainNode.cpp:82:10: error: ‘word DirectGraphicalModels::ITrain::m_nFeatures’ is private within this context Mat vec(m_nFeatures, 1, CV_8UC1); ^~~~~~~~~~~ In file included from /home/aliyasineser/DGM/modules/DGM/TrainNode.h:5:0, from /home/aliyasineser/DGM/modules/DGM/TrainNode.cpp:1: /home/aliyasineser/DGM/modules/DGM/ITrain.h:41:8: note: declared private here word m_nFeatures; ///< The number of features (length of the feature vector) ^~~~~~~~~~~ modules/DGM/CMakeFiles/DGM.dir/build.make:974: recipe for target 'modules/DGM/CMakeFiles/DGM.dir/TrainNode.cpp.o' failed make[2]: *** [modules/DGM/CMakeFiles/DGM.dir/TrainNode.cpp.o] Error 1 CMakeFiles/Makefile2:85: recipe for target 'modules/DGM/CMakeFiles/DGM.dir/all' failed make[1]: *** [modules/DGM/CMakeFiles/DGM.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2
I solved the problem, changed m_nFeatures from private to public. It can be protected maybe, but since it is a design issue I want to report so you can probably find a better solution for the library. The variable in ITrain.h .
And after successful build, I could manage to use and import DGM.h so it means the main problem solved. Thank you. Issue still open due to second problem, it is possible to open second issue if necessary. Thanks

from dgm.

ereator avatar ereator commented on June 9, 2024

@aliyasineser That's a new bug from yesterday.
I have just fixed that: I used the accessor getNumFeatures() instead of m_nFeatures.

from dgm.

aliyasineser avatar aliyasineser commented on June 9, 2024

Then we can close the issue, DGM is working. Thank you @ereator 👍

from dgm.

Related Issues (17)

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.