Khadijeh_Arabi:

    for batch_idx, (data,cond) in enumerate(train_loader):



It seems you are expecting two values (data, cond) from data_gen().
But it seems to return a tensor.



 Khadijeh_Arabi:

    return centers + noise


When python tries to assign two values to data, cond variables, it seems there are excess elements in the tensor received. Hence the error too many values to unpack, I think.