Comments (2)
Hi @alimoeeny thank you for the kind words!
Honestly, I have never tested multiple inferences of the same model in multiple go routines. I guess, being the forward pass handled by the C library, the TensorFlow backend should already handle the concurrency - but it's just a guess.
Now that I'm thinking about it (keep this message as a stream of consciousness from my side lol), I guess it's instead the exact opposite. The thread safety is left to the user in the C library - and this would make sense.
Because the nature of the SavedModel is complex. There could be SavedModel stateful (where, for example, the TensorFlow program updates internal tf.Variable
nodes), or SavedModel stateless (the serialization of some tf.*
operation without a state).
For this reason, the best thing to do is to left to the user the hassle of handling the multi-threading stuff.
If your SavedModel is stateless, who cares about thread safety, otherwise you should handle it
Keep this message for what it is - just some thoughts about this topic. The best thing to do is to experiment. If you can do it, everyone that uses tfgo will benefit from your tests (right now I'm busy working on a different Go software
from tfgo.
thank you very much @galeone
I'll post to this thread if I discovered any concrete information, either from the docs or by experimentation :)
from tfgo.
Related Issues (20)
- tf.Variable support HOT 1
- windows installation error HOT 5
- 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
- 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
- tfgo Object detection
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.