acherstyx/DDoS-DeepLearning-Approach

关于第二次使用load_feature加载攻击流量特征得到空list的问题

LuckyChili opened this issue · 0 comments

你好!我是小菜鸟,最近在学习您的项目对流量进行处理,我想通过udp.csv从不同的pcap文件里取两个攻击集,您的源码如下:
attack_label_dict = load_label("dataset/CIC_DDoS_2019/CSV/03-11/UDP.csv", CACHE_ROOT + "label_from_csv_cache")
attack_feature_list = list(load_feature(files,
pkt_in_each_flow_limit=CNN_SHAPE[0],
label_dict=attack_label_dict,
sample_limit_dict={"BENIGN": 0, "MSSQL": 0, "UDP": SAMPLE_NUMBER}))
attack_label_dict = parsing_label(attack_label_dict)
但发现第二次构成的attack_feature_list长度为0,
我修改的代码:
#训练集
attack_label_dict = load_label("./dataset/CICDDoS2019/CSV/UDP.csv", CACHE_ROOT + "label_from_csv_cache")
#attack_label_dict2 = attack_label_dict
attack_feature_list = list(load_feature(files,
pkt_in_each_flow_limit=FEATURE_SHAPE[0],
label_dict=attack_label_dict,
sample_limit_dict={"BENIGN": 0, "MSSQL": 0, "UDP": 0.8*SAMPLE_NUMBER}))
attack_label_dict = parsing_label(attack_label_dict)
#测试集
attack_label_dict2 = load_label("./dataset/CICDDoS2019/CSV/UDP.csv", CACHE_ROOT + "label_from_csv_test_cache")
attack_feature_test_list = list(load_feature(test_files, #这里选择的file和前面的不同
pkt_in_each_flow_limit=FEATURE_SHAPE[0],
label_dict=attack_label_dict2,
sample_limit_dict={"BENIGN": 0, "MSSQL": 0,
"UDP": 0.2 * SAMPLE_NUMBER}))
attack_label_dict2 = parsing_label(attack_label_dict2)

logger.debug("loaded attack_test_list_num : %s", len(attack_feature_test_list))
显示DEBUG:main:loaded attack_list_test_num : 0

不知道是我哪里做错了,是什么原因呢?向您请教,希望得到回复
(也不知道这样使用对不对)