Comments (2)
Ahh that makes sense - sorry for the easy question! Thank you so much, this is exactly what I needed! I am glad you enjoyed the book :)
from protox.
Hello! I'm glad to know that you found the library easy to use :-)
The output you got is expected: protox outputs IO data, a data structure to optimize the generation of large volumes of data.
All output functions should be able to take this kind of data as a parameter. In your case, if you want to write encoded
to a file:
iex> data = File.read!("resnet18-v1-7.onnx")
iex> decoded = Onnx.ModelProto.decode!(data)
iex> encoded = Onnx.ModelProto.encode!(decoded)
iex> {:ok, file} = File.open("msg.bin", [:write])
iex> IO.binwrite(file, encoded)
If you want a good old binary, use :binary.list_to_bin()
:
iex> encoded = decoded |> Onnx.ModelProto.encode!() |> :binary.list_to_bin()
<<8, 3, 58, 244, 218, 169, 22, 10, 172, 1, 10, 4, 100, 97, 116, 97, 10, 22, 114,
101, 115, 110, 101, 116, 118, 49, 53, 95, 99, 111, 110, 118, 48, 95, 119, 101,
105, 103, 104, 116, 18, 19, 114, 101, 115, 110, 101, 116, 118, 49, ...>>
iex> data == encoded
true
Does this answer your question?
BTW, I really enjoyed your book on genetic algorithms, and congrats for your work on Nx ;-)
from protox.
Related Issues (20)
- Generating code for services? HOT 7
- Supporting FileOptions HOT 9
- key not found when encoding optional fields HOT 10
- [Feature request] support `extend` when nested inside a message definition HOT 9
- Feature request: ability to ignore unknown fields and not have __uf__ properties in structs HOT 6
- Not seeing mix tasks HOT 6
- protox and the `package` directive (was: Proposal - Support Namespace definition when use files generation) HOT 4
- [BUG] Fix compile warning when use --keep-unknown-fields=false HOT 1
- Fails to generate module HOT 1
- Enable manual import path specification HOT 2
- Proto3 Field Presence HOT 3
- feature request: ability to inject definition into existing module HOT 6
- [BUG] README.md contains misleading examples HOT 1
- [BUG] Compilation of Protox 1.6 fails HOT 6
- Inconsistency in generated functions specs? HOT 1
- [QUESTION] Enums implementation HOT 9
- [Feature Request] support for decimal 1.9.x HOT 4
- [BUG] The code generated is not deterministic HOT 6
- [BUG] HOT 4
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 protox.