google-ai-edge / LiteRT

LiteRT is the new name for TensorFlow Lite (TFLite). While the name is new, it's still the same trusted, high-performance runtime for on-device AI, now with an expanded vision.
https://ai.google.dev/edge/litert
Apache License 2.0
169 stars 14 forks source link

TfLite 2.13 with -DTFLITE_ENABLE_GPU=ON fails to build with Visual Studio 2019 and 2022 #165

Open gaikwadrahul8 opened 3 days ago

gaikwadrahul8 commented 3 days ago

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

No

Source

source

TensorFlow version

tf 2.13

Custom code

No

OS platform and distribution

Windows 10

Mobile device

No response

Python version

No response

Bazel version

No response

GCC/compiler version

Visual Studio 2019 and 2022

CUDA/cuDNN version

No response

GPU model and memory

No response

Current behavior?

Building TfLite 2.13 with cmake and -DTFLITE_ENABLE_GPU=ON fails if Visual Studio 2019 or 2022 is used. Tested on two different machines, it fails on both machines. Steps executed in Windows Command Prompt:

git clone --single-branch --branch r2.13 https://github.com/tensorflow/tensorflow tensorflow_src
mkdir tflite_build_x64
cd tflite_build_x64
cmake -DTFLITE_ENABLE_GPU=ON ..\tensorflow_src\tensorflow\lite
cmake --build . -j 8 --config Release

The cmake build command yields two errors:

C:\Users\bartp\source\TfLite2.13Gpu\tensorflow_src\tensorflow\lite\delegates\gpu\common\selectors\operation_selector.cc(313,20): error C2039: 'any_cast': is not a member of 'std' [C:\Users\bartp\source\TfLite2.13Gpu\tflite_build_x64\tensorflow-lite.vcxproj]
C:\Users\bartp\source\TfLite2.13Gpu\tensorflow_src\tensorflow\lite\delegates\gpu\common\tasks\special\conv_pointwise.cc(129,12): error C2039: 'any_cast': is not a member of 'std' [C:\Users\bartp\source\TfLite2.13Gpu\tflite_build_x64\tensorflow-lite.vcxproj]

To fix this, add #include <any> to tensorflow\lite\delegates\gpu\common\selectors\operation_selector.cc and tensorflow\lite\delegates\gpu\common\selectors\operation_selector.cc

Standalone code to reproduce the issue

To reproduce the issue: see my earlier writing.

Relevant log output

No response

gaikwadrahul8 commented 3 days ago

This issue originally reported by @misterBart has been moved to this dedicated repository for LiteRT to enhance issue tracking and prioritization. To ensure continuity, we have created this new issue on your behalf.

We appreciate your understanding and look forward to your continued involvement.