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: need at least one array to concatenate #15

Open
AzadehGh opened this issue Feb 11, 2021 · 6 comments
Open

ValueError: need at least one array to concatenate #15

AzadehGh opened this issue Feb 11, 2021 · 6 comments

Comments

@AzadehGh
Copy link

Hello
according to https://github.com/genaris/deepsleepnet I made some changes to run this code on Python 3.7. after solving some warnings about packages compatibility this error is not solved yet:

(Python f) F:\PhD\5th semester\Deep Learning\project\Python f>python seq2seq_sleep_sleep-EDF.py --data_dir data_2013/eeg_fpz_cz --output_dir output_2013 --n_folds 6
2021-02-11 14:47:47.456383

========== [Fold-0] ==========

Load training set:

Load Test set:

Training set: n_subjects=0
Number of examples = 0
Traceback (most recent call last):
File "seq2seq_sleep_sleep-EDF.py", line 757, in
tf.app.run()
File "F:\PhD\5th semester\Deep Learning\project\Python f\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "seq2seq_sleep_sleep-EDF.py", line 755, in main
run_program(hparams,FLAGS)
File "seq2seq_sleep_sleep-EDF.py", line 500, in run_program
X_train, y_train, X_test, y_test = data_loader.load_data(seq_len=hparams.max_time_step)
File "F:\PhD\5th semester\Deep Learning\project\Python f\dataloader.py", line 160, in load_data
self.print_n_samples_each_class(np.hstack(label_train),self.classes)
File "F:\PhD\5th semester\Deep Learning\project\Python f\lib\site-packages\numpy\core\shape_base.py", line 340, in hstack
return _nx.concatenate(arrs, 1)
ValueError: need at least one array to concatenate

it seems that the data is not loaded. I would appreciate if you could let me know the solution.

@MousaviSajad
Copy link
Owner

MousaviSajad commented Feb 13, 2021 via email

@AzadehGh
Copy link
Author

Hello
thanks a lot for your answer. I tried using Google Colab and it is solved. but due to limited time I need to change the number of folds. I do it through this command in run as you said:
python seq2seq_sleep_sleep-EDF.py --data_dir data_2013/eeg_fpz_cz --output_dir output_2013 --n_folds 20
but it was not applied. according to this line:
tf.app.flags.DEFINE_integer('num_folds', 20,
"""Number of cross-validation folds.""")
I changed the command to num_fold too, but it is not applied again. and run is stopped in fold 15 because of time and I can not get any results.

@AzadehGh
Copy link
Author

Hi again
I guess because the name in data loader is n_folds but in sleep_sleep_seq2seq is num_folds. shouldn't these to have the same name?

@MousaviSajad
Copy link
Owner

MousaviSajad commented Feb 17, 2021 via email

@AzadehGh
Copy link
Author

Hi
thanks a lot for your answer. I did both of them. but unfortunately it didn't work.

@MousaviSajad
Copy link
Owner

MousaviSajad commented Feb 17, 2021 via email

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

2 participants