PySyft icon indicating copy to clipboard operation
PySyft copied to clipboard

get_model got an error

Open IMVector opened this issue 4 years ago • 2 comments

Description

from syft.proto.lib.python.list_pb2 import List as ListPB pb.ParseFromString(req.content) got an error

How to Reproduce

  1. run examples/federated-learning/model-centric/mcfl_create_plan.ipynb
  2. Download model step
  3. execute get_model()

Expected Behavior

A clear and concise description of what you expected to happen.

Screenshots

image

System Information

  • OS Version: ubuntu18.04
  • Language Version: python 3.9
  • PySyft-0.5.0rc2
  • PyGrid-0.5.0rc1

DecodeError Traceback (most recent call last) in 1 # Model ----> 2 model_params_downloaded = get_model(grid_address, worker_id, request_key, model_id) 3 print("Params shapes:", [p.shape for p in model_params_downloaded])

in get_model(grid_address, worker_id, request_key, model_id) 5 model_data = req.content 6 pb = ListPB() ----> 7 pb.ParseFromString(req.content) 8 return deserialize(pb)

DecodeError: Error parsing message

new problem

When I solved the last error there is another error


ValueError Traceback (most recent call last) in 1 # Model ----> 2 model_params_downloaded = get_model(grid_address, worker_id, request_key, model_id) 3 print("Params shapes:", [p.shape for p in model_params_downloaded])

in get_model(grid_address, worker_id, request_key, model_id) 7 print(model_data) 8 pb.ParseFromString(req.content) ----> 9 return deserialize(pb)

~/anaconda3/envs/syft_python3.9/lib/python3.9/site-packages/syft/core/common/serde/deserialize.py in _deserialize(blob, from_proto, from_bytes) 87 traceback_and_raise(deserialization_error) 88 ---> 89 res = _proto2object(proto=blob) 90 return res

~/anaconda3/envs/syft_python3.9/lib/python3.9/site-packages/syft/lib/python/list.py in _proto2object(proto) 156 @staticmethod 157 def proto2object(proto: List_PB) -> "List": --> 158 id: UID = deserialize(blob=proto.id) 159 value = [] 160 # list comprehension doesn't work since it results in a

~/anaconda3/envs/syft_python3.9/lib/python3.9/site-packages/syft/core/common/serde/deserialize.py in _deserialize(blob, from_proto, from_bytes) 87 traceback_and_raise(deserialization_error) 88 ---> 89 res = _proto2object(proto=blob) 90 return res

~/anaconda3/envs/syft_python3.9/lib/python3.9/site-packages/syft/core/common/uid.py in _proto2object(proto) 189 if you wish to deserialize an object. 190 """ --> 191 return UID(value=uuid.UUID(bytes=proto.value)) 192 193 @staticmethod

~/anaconda3/envs/syft_python3.9/lib/python3.9/uuid.py in init(self, hex, bytes, bytes_le, fields, int, version, is_safe) 184 if bytes is not None: 185 if len(bytes) != 16: --> 186 raise ValueError('bytes is not a 16-char string') 187 assert isinstance(bytes, bytes_), repr(bytes) 188 int = int_.from_bytes(bytes, byteorder='big')

ValueError: bytes is not a 16-char string

IMVector avatar May 17 '21 03:05 IMVector

Hi, I've got the same problem. Did anybody manage to solve this ?

rmic avatar Aug 02 '21 14:08 rmic

Hi, I am facing same error bytes is not a 16-char string in return deserialize(pb) line of get_model(...) function. Has anyone been able to solve it?

sarthak-chakraborty avatar Oct 07 '21 17:10 sarthak-chakraborty

0.5 is no longer supported.

madhavajay avatar Nov 17 '22 07:11 madhavajay