fangvv / FL-PQSU

Code for paper "Accelerating Federated Learning for IoT in Big Data Analytics with Pruning, Quantization and Selective Updating"
https://fangvv.github.io/Homepage/Edgecomp/
12 stars 2 forks source link

list index out of range #3

Open Misbah-Said opened 4 weeks ago

Misbah-Said commented 4 weeks ago

Hello,

I have taken code from a GitHub repository for quantization and pruning in a Federated Learning (FL) environment. However, I am facing a "list index out of range" error in one of the pruning files. Even if I try to resolve it by adding a if(condition), it still gives me the "index out of range" error means it execute only else part every time.so I am confused why it again & again execute else part only. I want to validate this else part execution is correct or not. I would be very grateful if someone could guide me on how to resolve this error.

code image

image error message

image if i put (if condition) it only execute else part only every time.

if index < len(load_scale) and index < len(load_zero_point):

    #     test_para = Quan.dequantize_tensor(load_scale[index], tensor_load_numpy, load_zero_point[index])
    #     print ("working")
    #     model.state_dict()[var_name].copy_(test_para)
    # else:
    #     print("index out of range{index}")
    #     break