aashrafh / Mozart

An optical music recognition (OMR) system. Converts sheet music to a machine-readable version.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while running main script

napulen opened this issue · comments

I get the following error while running the main script as

python src/main.py testcases output
Traceback (most recent call last):
  File "src/main.py", line 255, in <module>
    main(args.inputfolder, args.outputfolder)
  File "src/main.py", line 243, in main
    imgs_with_staff, imgs_spacing, imgs_rows)
  File "src/main.py", line 120, in recognize
    labels = predict(saved_img)
  File "/home/napulen/Mozart/src/fit.py", line 11, in predict
    train('NN', 'hog', 'nn_trained_model_hog')
  File "/home/napulen/Mozart/src/train.py", line 118, in train
    model, accuracy = run_experiment(model_name, feature_name, dir_names)
  File "/home/napulen/Mozart/src/train.py", line 104, in run_experiment
    features, labels, test_size=0.2, random_state=random_seed)
  File "/home/napulen/miniconda3/envs/mozart2/lib/python3.7/site-packages/sklearn/model_selection/_split.py", line 2131, in train_test_split
    default_test_size=0.25)
  File "/home/napulen/miniconda3/envs/mozart2/lib/python3.7/site-packages/sklearn/model_selection/_split.py", line 1814, in _validate_shuffle_split
    train_size)
ValueError: With n_samples=0, test_size=0.2 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters.

Any idea what's going on?

I had the same issue at first. You have to run it directly in the main dir. So instead of python src/main.py testcases output run python main.py ..\testcases ..\output . Else it wont find the trained models, and therefore tries to train instead of analysing, I think.

You are right. Now it is working. Thanks!