bharatnishant / IDS

Created Network Intrusion Detection System using Pytorch
15 stars 3 forks source link

Issue Running IDS #1

Open gabdelmoumin opened 4 years ago

gabdelmoumin commented 4 years ago

Hi Nishant, thank you for sharing this code. I am new to using ML to create IDS systems. When I run the code in python using the PyTorch framework, I receive the following error:

Traceback (most recent call last): df_tensor_y_test = (torch.tensor(df_ytest.values)).type(torch.FloatTensor) TypeError: can't convert np.ndarray of type numpy.object. The only supported types are: float64, float32, float16, int64, int32, int16, int8, uint8, and bool.

Any help is appreciated!

bharatnishant commented 3 years ago

@gabdelmoumin Could you please share the code snippet where this problem did occur? It works fine here.

gabdelmoumin commented 3 years ago

Hi Nishant,

Thank you very much for getting back to me. I truly appreciate it. Please find below the code snippet and the error I receive when I run the program. I am using PyCharm.

Traceback (most recent call last): File "C:/Users/admou/PycharmProjects/ids/ids.py", line 119, in df_tensor_y_test = (torch.tensor(df_ytest.values)).type(torch.FloatTensor) TypeError: can't convert np.ndarray of type numpy.object. The only supported types are: float64, float32, float16, int64, int32, int16, int8, uint8, and bool.

df_tensor = torch.tensor(df_x_scaled.values) df_tensor_y = torch.tensor(df_y)

df_tensor_test = (torch.tensor(df_x_test_scaled.values)).type(torch.FloatTensor) df_tensor_y_test = (torch.tensor(df_y_test.values)).type(torch.FloatTensor) # this is the line creating the TypeError

type(df_tensor) df_tensor

df_tensor_test

df_tensor_y

Best regards,

Ghada

On Thu, Oct 15, 2020 at 6:51 AM Nishant Bharat notifications@github.com wrote:

@gabdelmoumin https://github.com/gabdelmoumin Could you please share the code snippet where this problem did occur? It works fine here.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bharatnishant/IDS/issues/1#issuecomment-709169944, or unsubscribe https://github.com/notifications/unsubscribe-auth/APUSDK2TQIU3MIUVYZ7QT7LSK3H4VANCNFSM4RCXGYWA .

SeekMoment commented 3 years ago

Hello, i have the same problem. How to fix it?