Open headius opened 7 years ago
@headius Thanks a lot for doing this.
I will look at this tomorrow and see if I come up with something.
I have faced the exact same issue that you are referring to and it bugged me a lot so I will try to see it.
Thanks again, This is cool.
I will look at that
Any news on this? It's a pity that this project is falling back, and FFI seems like the way forward.
Or maybe this is the way to go?
TensorStream, a pure ruby machine learning framework (with OpenCL support) based on TensorFlow.
https://github.com/jedld/tensor_stream
https://medium.com/@joseph.dayo/tensorstream-bringing-machine-learning-to-ruby-114582060e3d
TensorStream, a pure ruby machine learning framework (with OpenCL support) based on TensorFlow.
I never noticed this comment but I wanted to point out that TensorStream is not actually wrapping TensorFlow like this library does, and only supports the OpenCL backend on CRuby anyway (pure-Ruby on other impls).
How about https://github.com/ankane/tensorflow-ruby ?
This is for #89.
I have taken the approach of simply swapping the FFI bindings in for the ext bindings and replacing any C wrappers around the TensorFlow API with Ruby+FFI versions of the same code.
So far things are working ok, but I'm stuck with a segfault (0x00 mem access) that I can't figure out. A call to TF_SetAttrTensor with a tensor created by the wrapper String_encoder method seems to be improperly initialized, later blowing up somewhere near Status::SlowCopyFrom in TensorFlow itself via a 0x0 pointer access.
There's also a small tweak to the generated code to modify the TF_StringEncode binding to have an out parameter for the destination. This will need some tweaks to ffi_gen to avoid, and there are likely other cases.
The segv I get is here...maybe someone will be able to help: https://gist.github.com/headius/752eb916bd3a9d39f2574a5a5f06d1f5
Obviously a lot more work to do here but I'm pleased with how far I got.