Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected outputs from examples #7

Closed
CarlPoirier opened this issue Jul 8, 2019 · 2 comments
Closed

Expected outputs from examples #7

CarlPoirier opened this issue Jul 8, 2019 · 2 comments

Comments

@CarlPoirier
Copy link
Contributor

CarlPoirier commented Jul 8, 2019

Hi,

I am running through the examples for this. I'm just wondering if it works correctly, especially for the mnist example, since the predictions are not accurate at all. I get this:

Real label: 0, predicted: 2, Probability: 1
Real label: 1, predicted: 0, Probability: 0.54904
Real label: 2, predicted: 2, Probability: 1
Real label: 3, predicted: 5, Probability: 0.639081
Real label: 4, predicted: 8, Probability: 0.472427
Real label: 5, predicted: 2, Probability: 1
Real label: 6, predicted: 8, Probability: 0.908674
Real label: 7, predicted: 5, Probability: 0.984732
Real label: 8, predicted: 2, Probability: 0.999436
Real label: 9, predicted: 5, Probability: 0.974823

It could be great to indicate what are the expected outputs for each example.

Thanks,

Carl

@serizba
Copy link
Owner

serizba commented Nov 13, 2019

Hi,

By just running the MNIST code using the provided model (model.pb) my results are the following:

Real label: 0, predicted: 0, Probability: 1
Real label: 1, predicted: 1, Probability: 0.999979
Real label: 2, predicted: 2, Probability: 1
Real label: 3, predicted: 3, Probability: 0.999999
Real label: 4, predicted: 4, Probability: 0.99907
Real label: 5, predicted: 5, Probability: 0.999991
Real label: 6, predicted: 6, Probability: 0.999366
Real label: 7, predicted: 7, Probability: 0.99999
Real label: 8, predicted: 8, Probability: 1
Real label: 9, predicted: 9, Probability: 0.999997

Maybe you retrained the model using different parameters and you got an unconverged solution.

@subramanya2107
Copy link

@serizba @CarlPoirier Am trying to run mnist but having problem in cmake.
CMake Error at CMakeLists.txt:5 (find_package):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.

Could not find a package configuration file provided by "OpenCV" with any
of the following names:

OpenCVConfig.cmake
opencv-config.cmake

Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.

abertoldi added a commit to kirasystems/cppflow that referenced this issue Jun 18, 2021
The ASan report is as follows:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==74==ERROR: AddressSanitizer: SEGV on unknown address 0x6030bf3b722e (pc 0x7fc277c6ae10 bp 0x7ffe22b2c9a0 sp 0x7ffe22b2c158 T0)
==74==The signal is caused by a READ memory access.
    #0 0x7fc277c6ae10  /build/glibc-eX1tMB/glibc-2.31/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:365
    #1 0x49d947 in __asan_memcpy (/home/docker/kiravision/test/clang-memtest+0x49d947)
    serizba#2 0x50e00a in TF_TString_ResizeUninitialized(TF_TString*, unsigned long) /opt/tensorflow/include/tensorflow/core/platform/ctstring_internal.h:278:7
    serizba#3 0x50ba34 in TF_TString_Copy(TF_TString*, char const*, unsigned long) /opt/tensorflow/include/tensorflow/core/platform/ctstring_internal.h:389:17
    serizba#4 0x50bbac in Model::restore(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/docker/kiravision/cppflow/src/Model.cpp:107:5
    serizba#5 0x4e98e2 in KiraVision::LearnedModel::LearnedModel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/docker/kiravision/src/LearnedModel.cpp:12:13
    serizba#6 0x4e28ed in KiraVision::TableDetector::TableDetector(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, KiraVision::LogLevel const&) /home/docker/kiravision/src/TableDetector.cpp:13:24
    serizba#7 0x4d058a in main /home/docker/kiravision/test/memtest.cpp:16:31
    serizba#8 0x7fc277bd30b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
    serizba#9 0x425ccd in _start (/home/docker/kiravision/test/clang-memtest+0x425ccd)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /build/glibc-eX1tMB/glibc-2.31/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:365
==74==ABORTING

The problem was incorrect initalization of a `TF_TString`. The existing
code initialized it as `new TF_Tstring` (which is not really any kind of
initalization, just memory allocation). `TF_TString`'s have to be
initialized with `TF_TString_Initialize` before they an be used. The
fact that the offending code is using a `unique_ptr` to ensure deletion
of the `TF_TString` makes it all a little clunky.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants