Open TurgutBababalim opened 1 year ago
I've tried adding SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
to cmake_install.cmake under tflite-opencl but it still generates the same error.
Update:
Apparently operation_selector.cc
does not include #include <any>
as it should, causing the aforementioned 'any_cast': is not a member of 'std'
error. After including and building it, I get a .lib file under tflite-opencl/Debug
(no .dll's found).
However, when I include it and try to use it on a project, I get many unresolved external symbol errors. Am I doing something wrong? Were there supposed to be a .dll file?
Hi @TurgutBababalim, this is effectively a duplicate of https://github.com/tensorflow/tensorflow/issues/61269
Yeah, I mentioned issue #61269 several months ago, and now more people bump into it...
Two possible solutions:
(1) Change std::any_cast
to absl::any_cast
(2) Add #include <any>
in operation_selector.cc and conv_pointwise.cc
You could propose a pull request with one of the above solutions. Though I believe such tiny matters can be solved far quicker by a Tensorflow member, than by an external person proposing a pull request.
Your other errors (as detailed in https://stackoverflow.com/q/76998448/7268445) are not related to the any_cast
problem.
Issue type
Build/Install
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
2.14
Custom code
Yes
OS platform and distribution
Widnows 10
Mobile device
Asus pc
Python version
3.11
Bazel version
6.1.4
GCC/compiler version
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
CUDA/cuDNN version
-
GPU model and memory
NVIDIA GeForce GTX 960m
Current behavior?
Relevant stackoverflow question: https://stackoverflow.com/questions/76990961/tensorflow-c-error-while-building-with-cmake-on-windows-with-gpu-support
I'm trying to get a tensorflow C++ build (or tensorflow lite) for Windows that runs on GPU (WITHOUT using CUDA, it should work on AMD). I decided to opt in for tensorflow lite with the -DTFLITE_ENABLE_GPU=ON flag to enable OpenCL.
Standalone code to reproduce the issue
Relevant log output
But despite these errors it kept on compiling and eventually ended on:
I think I'm getting the
any_cast is not a member of std
because my C++ standard version is below 14. But I've been coding in windows for a while and I'm pretty sure I'm above 17 as I use many modern features. I've updated g++ from Visual Studio Installer but I'm not sure how to properly update my C++ version on Windows.I'm sure this build has failed, but regardless I searched for the dll.
This failed build gave me a Visual Studio solution inside tflite-opencl. I need to import tflite into a huge project so I need either the dll files or the lib files. I tried looking under
tflite-opencl/Release
,tflite-opencl/Debug
andtflite-opencl/x64
but found nothing. I'm also adviced to look under\bazel-bin\tensorflow\lite\kernels
on [my previous question][1], which I can find undertensorflow_src
and I can't find any dll's in it.How can I fix that error and change my C++ standard on Windows? How can I get these dll or lib files to use under my project? If I should build
INSTALL
how am I supposed to do it? I developed mainly on Linux environments so I don't know how to use Visual Studio propperly.