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

Weird error #3

Open
aletote opened this issue Jun 2, 2019 · 0 comments
Open

Weird error #3

aletote opened this issue Jun 2, 2019 · 0 comments

Comments

@aletote
Copy link

aletote commented Jun 2, 2019

Getting this when running vae_training.py (after it imports all the midi files), could you help me please?

.
.
.
Total steps (notes + silent): 2752064
Total samples: 43001
[1.09267808e-01 4.16398747e-01 0.00000000e+00 3.59985585e-01
3.40064972e-01 3.50594625e-01 7.46470084e-03 1.61417231e-02
1.12797230e-04 3.32733292e-03 5.35355538e-03 2.67526337e+00
1.54661519e+00 2.02079281e+00 5.00641917e-01]
[1.31664972e-01 4.16811501e-01 1.00000000e-10 2.99468883e-01
2.83918970e-01 2.91932461e-01 1.08097120e-02 2.48292100e-02
2.10019301e-03 6.62183705e-03 8.46493833e-03 3.14200168e+00
2.29949197e+00 2.51843892e+00 9.06115076e-01]
Training model...
Epoch 0 of 2000 Epochs
Training:
Beta: 0.1
Epsilon std: 0.01
Traceback (most recent call last):
File "vae_training.py", line 809, in
verbose=False)
File "/home/usuario/miniconda3/envs/fastai2/lib/python3.6/site-packages/keras/engine/training.py", line 952, in fit
batch_size=batch_size)
File "/home/usuario/miniconda3/envs/fastai2/lib/python3.6/site-packages/keras/engine/training.py", line 809, in _standardize_user_data
y, self._feed_loss_fns, feed_output_shapes)
File "/home/usuario/miniconda3/envs/fastai2/lib/python3.6/site-packages/keras/engine/training_utils.py", line 273, in check_loss_and_target_compatibility
' while using as loss categorical_crossentropy. '
ValueError: You are passing a target array of shape (5, 1) while using as loss categorical_crossentropy. categorical_crossentropy expects targets to be binary matrices (1s and 0s) of shape (samples, classes). If your targets are integer classes, you can convert them to the expected format via:

from keras.utils import to_categorical
y_binary = to_categorical(y_int)

Alternatively, you can use the loss function sparse_categorical_crossentropy instead, which does expect integer targets.

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

1 participant