Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Expect x to be a non-empty array or dataset #1

Open
vinhqdang opened this issue Aug 10, 2021 · 3 comments
Open

ValueError: Expect x to be a non-empty array or dataset #1

vinhqdang opened this issue Aug 10, 2021 · 3 comments

Comments

@vinhqdang
Copy link

Hi there

First of all, many thanks for publishing the code.

I am trying to re-run your code (TensorFlow version).

What I did:

  • install latest tensorflow (CPU version) 2.5
  • numpy 1.19 (otherwise there will be an error of feeding tensorflow to numpy).
  • networkx 2.6.2
  • matplotlib

I downloaded the CICIDS 2017, unzip the file GeneratedLabelledFlows.zip and get the list of 8 CSV files.

For each CSV file, I sort them by Timestamp column, then store first 70% of lines to train.csv and last 30% to val.csv

The code:

for i,f in tqdm (enumerate (csv_files)):
    fname = join ('TrafficLabelling', f)
    df = pd.read_csv (fname, low_memory=False)
    df = df.sort_values (by = ' Timestamp')
    N = df.shape [0]
    train_filename = 'train/' + f
    val_filename = 'val/' + f
    df_train = df[0:int(N*.7)]
    df_val = df[int(N*.7):]
    df_train.to_csv (train_filename, index = False)
    df_val.to_csv (val_filename, index = False)

Then I modify the config.ini and run python main.py (Python 3.8.11)

I got the following error:

raise ValueError('Expect x to be a non-empty array or dataset.')
ValueError: Expect x to be a non-empty array or dataset.

Do you have any idea what did I do wrong?

Many thanks

@justussoh
Copy link

@vinhqdang Did you manage to solve the issue?

@vinhqdang
Copy link
Author

hi @justussoh , no, I did not

@otmanjai
Copy link

@vinhqdang & @justussoh Did you manage to solve the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants