Comments (5)
I have no idea since I don't use windows. But we treated this topic some time ago in another issue, and it looks like Go bindings on Windows are not officially supported, but if you're willing to hack a little bit it seems possible to make them work #46 (comment)
I haven't tried it since I don't have a Windows machine
from tfgo.
Hello, lucky to meet here, I also had the same problem on Windows and it was solved after trying some scenarios.
As a share, hope it helps:
(1) First you need a 64-bit gcc environment (MINGW64) and properly configured to the environment variables (so that go can be called);
(2) Next, you need to go to the Tensorflow distribution API (https://www.tensorflow.org/install/lang_c) to download the corresponding C version API;
(3) Extract to a suitable directory, then you need to add the directory to the environment variable and log out of the system to log in again.
PS: (My own solution is to directly merge 'lib' and 'include' in the file into 'lib' and 'include' under MINGW64, even if this is not easy to manage, but the configuration environment variables are omitted);The MINGW64 I use is supported by msys64.
You can then check that tensorflow's C API can be successfully called with the following simple code:
#include <stdio.h>
#include <tensorflow/c/c_api.h>
//Note: Include files start with tensorflow layers,if not find, check your environment variables
int main() {
printf("Hello from TensorFlow C library version %s\n", TF_Version());
return 0;
}
and Compile the sample program to create an executable file, and then run the following command:
gcc hello_tf.c -ltensorflow -o hello_tf
./hello_tf
[output]:Hello from TensorFlow C library version number
After that, you can use "go get" to continue installing 'tfgo' and determine whether it is available through the examples in the documentation
from tfgo.
hey @iFANGXIE this is great news!
This process can be helpful for other Windows users. Can you open a merge request adding this in a new section in the README?
If you speak Chinese, it would be also great if you can update the README.cn.md file. Thank you!
from tfgo.
Hello, lucky to meet here, I also had the same problem on Windows and it was solved after trying some scenarios.
As a share, hope it helps:
(1) First you need a 64-bit gcc environment (MINGW64) and properly configured to the environment variables (so that go can be called);
(2) Next, you need to go to the Tensorflow distribution API (https://www.tensorflow.org/install/lang_c) to download the corresponding C version API;
(3) Extract to a suitable directory, then you need to add the directory to the environment variable and log out of the system to log in again.
PS: (My own solution is to directly merge 'lib' and 'include' in the file into 'lib' and 'include' under MINGW64, even if this is not easy to manage, but the configuration environment variables are omitted);The MINGW64 I use is supported by msys64.
You can then check that tensorflow's C API can be successfully called with the following simple code:
#include <stdio.h> #include <tensorflow/c/c_api.h> //Note: Include files start with tensorflow layers,if not find, check your environment variables int main() { printf("Hello from TensorFlow C library version %s\n", TF_Version()); return 0; }and Compile the sample program to create an executable file, and then run the following command:
gcc hello_tf.c -ltensorflow -o hello_tf ./hello_tf [output]:Hello from TensorFlow C library version numberAfter that, you can use "go get" to continue installing 'tfgo' and determine whether it is available through the examples in the documentation
still not work TnT
from tfgo.
Related Issues (20)
- so gpu how to use HOT 1
- tf.Variable support HOT 1
- loading model HOT 2
- cc1.exe: sorry, unimplemented: 64-bit mode not compiled in HOT 1
- Error: W tensorflow/core/framework/op_kernel.cc:1745] OP_REQUIRES failed at lookup_table_op.cc:929 : FAILED_PRECONDITION: Table not initialized. HOT 1
- SparseTensor support HOT 2
- Failed to go get tfgo HOT 3
- tensor example support HOT 6
- Potential memory leak on reloading model HOT 8
- libtensorflow.so: .dynsym local symbol at index 3 (>= sh_info of 3) HOT 2
- Matching between output tensor name and prediction HOT 7
- Thread safety HOT 2
- Panic vs Error HOT 2
- Reading jpg image from disk and passing as input to a pretrained model loaded from disk HOT 4
- Error building "Getting Started" example: rebuild TensorFlow with the appropriate compiler flags HOT 5
- Can I use tfgo for tensorflow 2.11.x? HOT 2
- Convert opencv's `mat` to tfgo's `tensor` HOT 7
- Dark Souls level frustration with compilation project with this library HOT 1
- Discrepancy between python and go outputs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tfgo.