Giter Club home page Giter Club logo

Comments (13)

GuoHuanyu avatar GuoHuanyu commented on April 28, 2024

I adjusted the order of header files as follows:
#include "tensorflow/lite/array.h"
#include "tensorflow/lite/builtin_ops.h"
#include "tensorflow/lite/c/c_api_types.h"
#include "tensorflow/lite/core/c/builtin_op_data.h"
#include "tensorflow/lite/core/c/common.h"
#include "tensorflow/lite/core/subgraph.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/util.h"
Additionally, I repeatedly executed the Bazel command and made multiple adjustments to the positions of these two functions until the compilation passed successfully.

from tensorflow.

icoo000 avatar icoo000 commented on April 28, 2024

I adjusted the order of header files as follows: #include "tensorflow/lite/array.h" #include "tensorflow/lite/builtin_ops.h" #include "tensorflow/lite/c/c_api_types.h" #include "tensorflow/lite/core/c/builtin_op_data.h" #include "tensorflow/lite/core/c/common.h" #include "tensorflow/lite/core/subgraph.h" #include "tensorflow/lite/kernels/kernel_util.h" #include "tensorflow/lite/util.h" Additionally, I repeatedly executed the Bazel command and made multiple adjustments to the positions of these two functions until the compilation passed successfully.

我也遇到相同的问题,请问你是如何修改这个文件的,能否把这个文件的全部代码发出来?

from tensorflow.

icoo000 avatar icoo000 commented on April 28, 2024

I adjusted the order of header files as follows: #include "tensorflow/lite/array.h" #include "tensorflow/lite/builtin_ops.h" #include "tensorflow/lite/c/c_api_types.h" #include "tensorflow/lite/core/c/builtin_op_data.h" #include "tensorflow/lite/core/c/common.h" #include "tensorflow/lite/core/subgraph.h" #include "tensorflow/lite/kernels/kernel_util.h" #include "tensorflow/lite/util.h" Additionally, I repeatedly executed the Bazel command and made multiple adjustments to the positions of these two functions until the compilation passed successfully.

我也遇到相同的问题,请问你是如何修改这个文件的,能否把这个文件的全部代码发出来?

from tensorflow.

GuoHuanyu avatar GuoHuanyu commented on April 28, 2024

I adjusted the order of header files as follows: #include "tensorflow/lite/array.h" #include "tensorflow/lite/builtin_ops.h" #include "tensorflow/lite/c/c_api_types.h" #include "tensorflow/lite/core/c/builtin_op_data.h" #include "tensorflow/lite/core/c/common.h" #include "tensorflow/lite/core/subgraph.h" #include "tensorflow/lite/kernels/kernel_util.h" #include "tensorflow/lite/util.h" Additionally, I repeatedly executed the Bazel command and made multiple adjustments to the positions of these two functions until the compilation passed successfully.

我也遇到相同的问题,请问你是如何修改这个文件的,能否把这个文件的全部代码发出来?
调整了这个文件里 stablehlo_reduce_window.txt
StridedReduce 和ReduceWindowImpl 两个函数的先后位置\tensorflow_src\tensorflow\lite\kernels\stablehlo_reduce_window.cc
Reversed the order of the functions StridedReduce and StridedReduce and ReduceWindowImpl in the file tensorflow_src\tensorflow\lite\kernels\stablehlo_reduce_window.cc.

from tensorflow.

pkgoogle avatar pkgoogle commented on April 28, 2024

Hi @GuoHuanyu, I'm actually running into a different issue when I compile... I suspect our environments are not matching. Did you follow these steps https://www.tensorflow.org/install/source_windows for your environment? Did you run the command in PowerShell under admin privileges or Through some other interface? Are you in the r2.16 branch or in master/nightly? Are you following any instructions/documentation to do this? Thanks for your help.

from tensorflow.

GuoHuanyu avatar GuoHuanyu commented on April 28, 2024

Hi @GuoHuanyu, I'm actually running into a different issue when I compile... I suspect our environments are not matching. Did you follow these steps https://www.tensorflow.org/install/source_windows for your environment? Did you run the command in PowerShell under admin privileges or Through some other interface? Are you in the r2.16 branch or in master/nightly? Are you following any instructions/documentation to do this? Thanks for your help.

  1. In above issues, i use the Developer Command Prompt for Visual Studio to execute the command bazel build --config=monolithic --define=with_select_tf_ops=true -c opt //tensorflow/lite:libtensorflowlite.so, bazel build -c opt //tensorflow/lite:tensorflowlite.dll. its ok for my environment.
  2. My environment includes Visual Studio 2019, Bazelisk, and Python 3.11.
  3. i follow these steps https://www.tensorflow.org/install/source_windows for my envirmonment to execute the command python ./configure.py , bazel build //tensorflow/tools/pip_package:build_pip_package using the source code from =https://github.com/tensorflow/tensorflow/releases/tag/v2.16.1.
  4. I am still encountering an error in stablehlo_reduce_window.cc. I fix it by reversing the order of the StridedReduce and ReduceWindowImpl functions, but the build process continues to fail with Developer Command Prompt or Developer PowerShell for Visual Studio in administrator mode, cl.exe D8022 error
  5. Giving up

from tensorflow.

pkgoogle avatar pkgoogle commented on April 28, 2024

Hi @GuoHuanyu, apologies for the frustration, while I look more into this -- have you tried building/progressing with WSL instead? Generally speaking that will be a smoother experience.

from tensorflow.

GuoHuanyu avatar GuoHuanyu commented on April 28, 2024

Hi @GuoHuanyu, apologies for the frustration, while I look more into this -- have you tried building/progressing with WSL instead? Generally speaking that will be a smoother experience.

I haven't heard of or used WSL before. I would find some time to configure and compile based on WSL. Thank you for providing another good method!

from tensorflow.

pkgoogle avatar pkgoogle commented on April 28, 2024

Hi @GuoHuanyu, another alternative if you need the tensorflow lite dll is building with cmake instead: https://www.tensorflow.org/lite/guide/build_cmake, let me know if that works for you or unblocks you. Thanks.

from tensorflow.

GuoHuanyu avatar GuoHuanyu commented on April 28, 2024

Hi @GuoHuanyu, another alternative if you need the tensorflow lite dll is building with cmake instead: https://www.tensorflow.org/lite/guide/build_cmake, let me know if that works for you or unblocks you. Thanks.

  1. Thank you for your timely and professional response.
  2. I've experimented with reversing the order of the StridedReduce and ReduceWindowImpl functions and managed to successfully compile TensorFlow Lite using the commands cmake ../tensorflow_src/tensorflow/lite and cmake --build . -j in the Developer PowerShell for Visual Studio.
  3. However, this only produced a tensorflow-lite.lib file of 247MB, and I did not get the corresponding tensorflow-lite.dll.
  4. That's why I resorted to using bazel build -c opt //tensorflow/lite:tensorflowlite.dll, which yielded both a lib and a dll file. I can obtain a dll with cmake ../tensorflow_src/tensorflow/lite/c and cmake --build . -j, but I am unsure if it corresponds to the previously generated tensorflow-lite.lib. That's why I used bazel build -c opt //tensorflow/lite:tensorflowlite.dll.
  5. If there is a way to generate both the lib and dll files using cmake, I believe it would be a better solution.

from tensorflow.

pkgoogle avatar pkgoogle commented on April 28, 2024

Hi @GuoHuanyu, if bazel build -c opt //tensorflow/lite:tensorflowlite.dll fits your needs, I would say just try it out and see if you run into any other issues. If you required source changes to get that working, and you feel it is something that should be generally fixed (we may need some compile time condition that checks for Windows or something), please create a PR with your fixes so that we may fix it more generally (or at least get started with the review process). Typically, users don't need the static library ... may I understand your use case/context better -- just to ensure you are using best practices, the .lib may not be necessary.

from tensorflow.

GuoHuanyu avatar GuoHuanyu commented on April 28, 2024

Hi @GuoHuanyu, if bazel build -c opt //tensorflow/lite:tensorflowlite.dll fits your needs, I would say just try it out and see if you run into any other issues. If you required source changes to get that working, and you feel it is something that should be generally fixed (we may need some compile time condition that checks for Windows or something), please create a PR with your fixes so that we may fix it more generally (or at least get started with the review process). Typically, users don't need the static library ... may I understand your use case/context better -- just to ensure you are using best practices, the .lib may not be necessary.

Ok,i will create a PR with my fixes, thank your timely response.

from tensorflow.

github-actions avatar github-actions commented on April 28, 2024

This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.

from tensorflow.

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.