Closed PaiStardian closed 8 months ago
你好作者,python generate_tiny_imagenet.py noniid - pat时 报错
Traceback (most recent call last): File "generate_tiny_imagenet.py", line 109, in generate_dataset(dir_path, num_clients, num_classes, niid, balance, partition) File "generate_tiny_imagenet.py", line 97, in generate_dataset X, y, statistic = separate_data((dataset_image, dataset_label), num_clients, num_classes, File "D:\研究\PFL-Non-IID-master\PFL-Non-IID-master\dataset\utils\dataset_utils.py", line 66, in separate_data num_per = num_all_samples / num_selected_clients ZeroDivisionError: division by zero 请问如何解决,感谢您的回复
Pathological 场景下,在Tiny-ImageNet上我们一般设定class_per_client=20,我直接在代码里加了这个设置,请查看。过小的class_per_client是有您这个问题的
class_per_client=20
class_per_client
你好作者,python generate_tiny_imagenet.py noniid - pat时 报错
Traceback (most recent call last): File "generate_tiny_imagenet.py", line 109, in
generate_dataset(dir_path, num_clients, num_classes, niid, balance, partition)
File "generate_tiny_imagenet.py", line 97, in generate_dataset
X, y, statistic = separate_data((dataset_image, dataset_label), num_clients, num_classes,
File "D:\研究\PFL-Non-IID-master\PFL-Non-IID-master\dataset\utils\dataset_utils.py", line 66, in separate_data
num_per = num_all_samples / num_selected_clients
ZeroDivisionError: division by zero
请问如何解决,感谢您的回复