mehrdadep / deep-learning-nids

A Deep Learning approach toward creating a NIDS using python
24 stars 8 forks source link

Error #1

Closed SeekMoment closed 3 years ago

SeekMoment commented 3 years ago

Traceback (most recent call last): File "C:/Users/maxim/PycharmProjects/deep-learning-nids-master/dnn.py", line 14, in x_train, y_train, x_test, y_test= data.return_processed_cicids_data_binary() File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 848, in return_processed_cicids_data_binary self.cicids_process_data_binary() File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 803, in cicids_process_data_binary numericalized_train_data_features = [self.numericalize_feature_cicids(x) for x in raw_train_data_features] File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 803, in numericalized_train_data_features = [self.numericalize_feature_cicids(x) for x in raw_train_data_features] File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 74, in numericalize_feature_cicids feature = [np.float64(-1) if(x == "Infinity" or x == "NaN") else np.float64(x) for x in feature] File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 74, in feature = [np.float64(-1) if(x == "Infinity" or x == "NaN") else np.float64(x) for x in feature] ValueError: could not convert string to float: '192.168.10.1-192.168.10.3-53-61676-17'

SeekMoment commented 3 years ago

Traceback (most recent call last): File "C:/Users/maxim/PycharmProjects/deep-learning-nids-master/gru.py", line 17, in x_train, y_train, x_test, y_test = data.return_processed_cicids_data_multiclass() File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 690, in return_processed_cicids_data_multiclass self.cicids_process_data_multiclass() File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 586, in cicids_process_data_multiclass train_data_8 = self.read_file_lines('cicids', 'Wednesday-workingHours.pcap_ISCX.csv') File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 25, in read_file_lines return content.readlines() MemoryError

mehrdadep commented 3 years ago

Traceback (most recent call last): File "C:/Users/maxim/PycharmProjects/deep-learning-nids-master/dnn.py", line 14, in x_train, y_train, x_test, y_test= data.return_processed_cicids_data_binary() File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 848, in return_processed_cicids_data_binary self.cicids_process_data_binary() File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 803, in cicids_process_data_binary numericalized_train_data_features = [self.numericalize_feature_cicids(x) for x in raw_train_data_features] File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 803, in numericalized_train_data_features = [self.numericalize_feature_cicids(x) for x in raw_train_data_features] File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 74, in numericalize_feature_cicids feature = [np.float64(-1) if(x == "Infinity" or x == "NaN") else np.float64(x) for x in feature] File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 74, in feature = [np.float64(-1) if(x == "Infinity" or x == "NaN") else np.float64(x) for x in feature] ValueError: could not convert string to float: '192.168.10.1-192.168.10.3-53-61676-17'

The DataProcess.py is designed to work with NSL-KDD and CICIDS2017 datasets (located in /data/nsl and /data/cicids/ directories). which one are you using?

SeekMoment commented 3 years ago

CICIDS2017

mehrdadep commented 3 years ago

Traceback (most recent call last): File "C:/Users/maxim/PycharmProjects/deep-learning-nids-master/gru.py", line 17, in x_train, y_train, x_test, y_test = data.return_processed_cicids_data_multiclass() File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 690, in return_processed_cicids_data_multiclass self.cicids_process_data_multiclass() File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 586, in cicids_process_data_multiclass train_data_8 = self.read_file_lines('cicids', 'Wednesday-workingHours.pcap_ISCX.csv') File "C:\Users\maxim\PycharmProjects\deep-learning-nids-master\DataProcess.py", line 25, in read_file_lines return content.readlines() MemoryError

Seems like you don't have enough memory to read the file. You have three options here.

SeekMoment commented 3 years ago

When i am trying to test in on ubuntu: i have this problem Traceback (most recent call last): File "/home/maxim/PycharmProjects/deep-learning-nids-master/dnn.py", line 14, in x_train, y_train, x_test, y_test= data.return_processed_cicids_data_binary() File "/home/maxim/PycharmProjects/deep-learning-nids-master/DataProcess.py", line 848, in return_processed_cicids_data_binary self.cicids_process_data_binary() File "/home/maxim/PycharmProjects/deep-learning-nids-master/DataProcess.py", line 739, in cicids_process_data_binary train_data_6 = self.read_file_lines('cicids', 'Thursday-WorkingHours-Morning-WebAttacks.pcap_ISCX.csv') File "/home/maxim/PycharmProjects/deep-learning-nids-master/DataProcess.py", line 25, in read_file_lines return content.readlines() File "/home/maxim/anaconda3/lib/python3.8/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 6014: invalid start byte

mehrdadep commented 3 years ago

I'll add a virtual env using pipenv to the repo and update the README.md file

SeekMoment commented 3 years ago

Okay, thank you