-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protobuf v1 #85
Protobuf v1 #85
Conversation
- used ProtoBuf.jl v1.0.x protojl package - updated imports - precompile returns load error "cannot replace module Version during compiliation" -> "Version" is an enum in the protobuf
- function in write.jl is overwriting an onnx3_pb.jl function
- set add_kwarg_constructors=true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good all in all. Thank you very much!
Please delete all the temporary dirs (i.e. pb_scratch, onnx and pbjl_scratch) in the root dir.
src/baseonnx/read.jl
Outdated
@@ -8,49 +8,49 @@ function array(p::TensorProto, wrap=Array) | |||
# Copy pasted from jl | |||
# Can probably be cleaned up a bit | |||
# TODO: Add missing datatypes... | |||
if p.data_type === TensorProto_DataType.INT64 | |||
if p.data_type === var"TensorProto.DataType".INT64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this less hideous looking by having something like
const TensorProto_DataType = var"TensorProto.DataType"
in BaseOnnx.jl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I took your suggestion in the latest commits.
Just checking if you need some assistance here. Seems like the constructor signature of protostructs have changed in ProtoBuf version 1.0 which causes pretty much every test case to fail. Hopefully it is just a few changes needed in https://github.com/DrChainsaw/ONNXNaiveNASflux.jl/blob/master/src/baseonnx/write.jl to make things pass. |
Yes, I could definitely use a hand. I was experimenting with making changes in My big worry is that, because the structs are immutable by default, a whole lot of test rewriting is needed. You're a better judge of this code, though. |
Yeah, this could be painful, or not. Not sure yet. I got a bit scared initially since I thought it would hit all over Lets take it one thing at the time. Latest commit I pushed fixed the constructors for a couple of protostructs used in the first two testsets in readwrite.jl. I suggest you take a look at the changes and try to make the last testset in there work. The main two things I needed to change was:
There are some migration tips here (although I did not find them very helpful for this work): https://juliaio.github.io/ProtoBuf.jl/dev/#Migrating-from-earlier-versions-of-ProtoBuf.jl |
Thanks for your help. I got most of the last testset working - see latest commit - but the
This should be covered by the last line of
but the output of the |
Hipshot guess here is that this is because the Base.Dict(pa::AbstractVector{<:AttributeProto}) = Dict(attribute(p) for p in pa) Note the extra |
Direct hit! |
I guess you got occupied with other stuff. Let me know if you intend to resume this work. |
@DrChainsaw yeah, to be honest I got stuck and moved on to other things. This is well above my expertise in Julia. |
Fix decode wanting type instead of instance Protos built from constructor instead of through mutation Fix protos not having undefined fields Update test code due to the above
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #85 +/- ##
=======================================
Coverage 96.06% 96.07%
=======================================
Files 15 15
Lines 1042 1044 +2
=======================================
+ Hits 1001 1003 +2
Misses 41 41 ☔ View full report in Codecov by Sentry. |
Add codecov fences to onnx3_pb.jl
Thanks for the help @lambe. Turns out you were about 80% there. Sorry for the long delay. |
read.jl
andwrite.jl
to handle new convention