Giter Club home page Giter Club logo

Comments (7)

alblib avatar alblib commented on July 18, 2024

These matters also did not work:

  • -DCPU_BASELINE="" -DCPU_DISPATCH=""
  • -DCV_ENABLE_INTRINSICS=OFF
  • -DCV_DISABLE_OPTIMIZATION=ON

from opencv.

asmorkalov avatar asmorkalov commented on July 18, 2024

@fengyuentau could you take a look?

from opencv.

fengyuentau avatar fengyuentau commented on July 18, 2024

@alblib I cannot reproduce your issue. Below is my code (build with latest opencv) trying to reproduce it. Can you run it on your side?

CMakeLists.txt:

cmake_minimum_required(VERSION 3.20)
project(test-opencv-linking)

find_package(OpenCV REQUIRED) #  HINTS "/absolute/path/to/opencv/build/install"

message(STATUS "OpenCV_INCLUDE_DIRS=${OpenCV_INCLUDE_DIRS}")
message(STATUS "OpenCV_LIBS=${OpenCV_LIBS}")

add_executable(main main.cpp)
target_link_libraries(main ${OpenCV_LIBS})
target_include_directories(main PUBLIC ${OpenCV_INCLUDE_DIRS})

main.cpp:

#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>

int main() {
    std::cout << cv::getBuildInformation() << std::endl;

    using namespace cv::dnn;
    auto net = readNet("resnet50.onnx");
    cv::Mat input(std::vector<int>{1, 3, 224, 224}, CV_32F);
    net.setInput(input);
    auto output = net.forward();
    std::cout << output.size << std::endl;

    return 0;
}

from opencv.

alblib avatar alblib commented on July 18, 2024

@fengyuentau Okay. I will test your code and other codes to find more detailed trace. maybe takes couple of days due to working hours

from opencv.

alblib avatar alblib commented on July 18, 2024

@fengyuentau On my side, same error occurs with even your code.

my system details:
iMac 2020

  • Processor: 3.6 GHz 10-Core Intel Core i9
  • Graphics: AMD Radeon Pro 5700 XT 16 GB
admin@iMacs-iMac opencv-test % cmake --build build --config Release
[ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable main
ld: warning: ignoring duplicate libraries: '-lm', '/Users/admin/illuni/library/illuni_engine_v3_new_scheme/_deps/opencv-install/Darwin_arm64/lib/libopencv_core.a', '/Users/admin/illuni/library/illuni_engine_v3_new_scheme/_deps/opencv-install/Darwin_arm64/lib/libopencv_imgproc.a'
Undefined symbols for architecture arm64:
  "cv::dnn::opt_NEON::convBlock_F32(int, float const*, float const*, float*, int, bool, int, int, int)", referenced from:
      std::__1::__function::__func<cv::dnn::runFastConv(cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, cv::Ptr<cv::dnn::dnn4_v20240521::ActivationLayer> const&, std::__1::vector<float, std::__1::allocator<float>> const&, bool)::$_4, std::__1::allocator<cv::dnn::runFastConv(cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, cv::Ptr<cv::dnn::dnn4_v20240521::ActivationLayer> const&, std::__1::vector<float, std::__1::allocator<float>> const&, bool)::$_4>, void (cv::Range const&)>::operator()(cv::Range const&) in 
  "cv::dnn::opt_NEON::convBlockMR1_F32(int, float const*, float const*, float*, float, bool, float, float, bool, int, int)", referenced from:
      std::__1::__function::__func<cv::dnn::runFastConv(cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, cv::Ptr<cv::dnn::dnn4_v20240521::ActivationLayer> const&, std::__1::vector<float, std::__1::allocator<float>> const&, bool)::$_4, std::__1::allocator<cv::dnn::runFastConv(cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, cv::Ptr<cv::dnn::dnn4_v20240521::ActivationLayer> const&, std::__1::vector<float, std::__1::allocator<float>> const&, bool)::$_4>, void (cv::Range const&)>::operator()(cv::Range const&) in 
  "cv::dnn::opt_NEON::winofunc_accum_F32(float const*, float const*, float*, int, int, int, int, int, int)", referenced from:
      std::__1::__function::__func<cv::dnn::runWinograd63(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, float, float, cv::dnn::dnn4_v20240521::ActivationLayer*, bool)::$_1, std::__1::allocator<cv::dnn::runWinograd63(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, float, float, cv::dnn::dnn4_v20240521::ActivationLayer*, bool)::$_1>, void (cv::Range const&)>::operator()(cv::Range const&) in 
  "cv::dnn::opt_NEON::winofunc_AtXA_8x8_F32(float const*, int, float*, int, float*, int, float, float, float, bool)", referenced from:
      std::__1::__function::__func<cv::dnn::runWinograd63(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, float, float, cv::dnn::dnn4_v20240521::ActivationLayer*, bool)::$_1, std::__1::allocator<cv::dnn::runWinograd63(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, float, float, cv::dnn::dnn4_v20240521::ActivationLayer*, bool)::$_1>, void (cv::Range const&)>::operator()(cv::Range const&) in 
  "cv::dnn::opt_NEON::winofunc_BtXB_8x8_F32(float const*, int, float*, int, int, int)", referenced from:
      std::__1::__function::__func<cv::dnn::runWinograd63(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, float, float, cv::dnn::dnn4_v20240521::ActivationLayer*, bool)::$_0, std::__1::allocator<cv::dnn::runWinograd63(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::Ptr<cv::dnn::FastConv> const&, int, float, float, cv::dnn::dnn4_v20240521::ActivationLayer*, bool)::$_0>, void (cv::Range const&)>::operator()(cv::Range const&) in 
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [main] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2

from opencv.

fengyuentau avatar fengyuentau commented on July 18, 2024

Processor: 3.6 GHz 10-Core Intel Core i9

So you are on a x64 host but cross-compiling for arm64 macOS? Let me try to reproduce your issue later this week.

from opencv.

alblib avatar alblib commented on July 18, 2024

@fengyuentau Yes! I am on x64 macOS host and cross-compiling for arm64 macOS! Thank you so much! I am looking forward to your reply.

from opencv.

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.