PySyft
PySyft copied to clipboard
Transforming a StorableObject to proto and back doesn't work
Description
Using _object2proto on a StorableObject to create a proto, and then using _proto2object on the result to create a StorableObject does not work
How to Reproduce
- Create a StorableObject
- Execute
StorableObject._object2protoon it to create a proto object - Execute
StorableObject._proto2objecton the proto object - See error
Expected Behavior
At the end we should see a valid StorableObject
Screenshots
storable
<Storable: <UID: 7ceb6fe14a094ed7b85addfcf9de4068>>
(Pdb) proto_storable = StorableObject._object2proto(storable)
(Pdb) proto_storable
id {
value: "\265\264\007\253\337>D\276\260]+`G\271\025~"
}
obj_type: "syft.core.store.storeable_object.StorableObject"
data {
type_url: "type.googleapis.com/syft.core.common.UID"
value: "\n\020|\353o\341J\tN\327\270Z\335\374\371\336@h"
}
description: "This is a dummy id"
tags: "dummy"
tags: "test"
type(proto_storable)
<class 'proto.core.store.store_object_pb2.StorableObject'>
StorableObject._proto2object(proto=proto_storable)
*** ValueError: bytes is not a 16-char string
System Information
- OS: Ubuntu
- OS Version: 18.04
- Language Version: Python 3.8.5
- Package Manager Version: pip 20.0.2
@Benardi how does this look with the new https://github.com/OpenMined/PySyft/pull/5104 changes?
Since we have completely overhauled the StorableObject code im going to assume this isn't an issue anymore.
There