Skuldur / Classical-Piano-Composer

MIT License
602 stars 318 forks source link

Shape Error #15

Closed calverca closed 5 years ago

calverca commented 5 years ago

Hello,

I ran the training file with no issues, but when I ran the predict file I received the error below. Can you help me understand how to fix this?

runfile('C:/Users/ccalvert/PycharmProjects/NeuralMusic/venv/predict.py', wdir='C:/Users/ccalvert/PycharmProjects/NeuralMusic/venv') Using TensorFlow backend. Traceback (most recent call last): File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\tensorflow\python\framework\ops.py", line 1628, in _create_c_op c_op = c_api.TF_FinishOperation(op_desc) tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension 1 in both shapes must be equal, but are 144 and 359. Shapes are [256,144] and [256,359]. for 'Assign_11' (op: 'Assign') with input shapes: [256,144], [256,359]. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", line 1, in File "C:\Program Files\JetBrains\PyCharm 2018.2.4\helpers\pydev_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "C:\Program Files\JetBrains\PyCharm 2018.2.4\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:/Users/ccalvert/PycharmProjects/NeuralMusic/venv/predict.py", line 135, in generate() File "C:/Users/ccalvert/PycharmProjects/NeuralMusic/venv/predict.py", line 25, in generate model = create_network(normalized_input, n_vocab) File "C:/Users/ccalvert/PycharmProjects/NeuralMusic/venv/predict.py", line 71, in create_network model.load_weights('weights.hdf5') File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\keras\engine\network.py", line 1166, in load_weights f, self.layers, reshape=reshape) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\keras\engine\saving.py", line 1058, in load_weights_from_hdf5_group K.batch_set_value(weight_value_tuples) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\keras\backend\tensorflow_backend.py", line 2465, in batch_set_value assign_op = x.assign(assign_placeholder) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\tensorflow\python\ops\variables.py", line 1718, in assign name=name) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\tensorflow\python\ops\state_ops.py", line 221, in assign validate_shape=validate_shape) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\tensorflow\python\ops\gen_state_ops.py", line 64, in assign use_locking=use_locking, name=name) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func return func(*args, **kwargs) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\tensorflow\python\framework\ops.py", line 3274, in create_op op_def=op_def) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\tensorflow\python\framework\ops.py", line 1792, in init control_input_ops) File "C:\Users\ccalvert\PycharmProjects\NeuralMusic\venv\lib\site-packages\tensorflow\python\framework\ops.py", line 1631, in _create_c_op raise ValueError(str(e)) ValueError: Dimension 1 in both shapes must be equal, but are 144 and 359. Shapes are [256,144] and [256,359]. for 'Assign_11' (op: 'Assign') with input shapes: [256,144], [256,359].

naganikshith04 commented 4 years ago

how did you solve this error? help please