stijani / tutorial

Contains codes for my published tutorials
30 stars 29 forks source link

Can't convert non-rectangular Python sequence to Tensor. #3

Open SamiurRahman1 opened 3 years ago

SamiurRahman1 commented 3 years ago

Hello, while trying to run the code, i am getting the following error:

File "fl_implemetation.py", line 49, in <module>
    clients_batched[client_name] = batch_data(data)
  File "/data/yali/sam/FLimplement/fl_mnist_implementation_tutorial_utils.py", line 85, in batch_data
    dataset = tf.data.Dataset.from_tensor_slices((list(data), list(label)))
........
ValueError: Can't convert non-rectangular Python sequence to Tensor.

tensor flow version: 2.3.1 any idea how to solve this problem? i also tried to use ragged Tensor but that doesn't help.