Skip to content

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

@vinhqdang

Description

@vinhqdang

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions