-
Notifications
You must be signed in to change notification settings - Fork 13
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
Dimension incompatibility Issue during Initialization #9
Comments
Same error occurred for me, python 3.8 running on Ubuntu via WSL on Windows:
Package Versions:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
Thanks for the initiative to bring this open source project.
I was on the way to give it a try, and found the error while executing the following line after importing the module successfully.
phoney = BigPhoney()
The error generated is mentioned below. Numpy 1.19.5 is installed. Any help towards resolution would be appreciated.
`---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in
----> 1 phoney = BigPhoney(preprocessors=[])
~/anaconda3/lib/python3.7/site-packages/big_phoney/big_phoney.py in init(self, preprocessors)
13 self.preprocessors = [preprocessor_class() for preprocessor_class in preprocessors]
14 self.phonetic_dict = PhoneticDictionary()
---> 15 self.pred_model = PredictionModel()
16
17 def apply_preprocessors(self, input_string):
~/anaconda3/lib/python3.7/site-packages/big_phoney/prediction_model.py in init(self, search_width)
14 self.search_width = search_width
15 self.utils = PredictionModelUtils()
---> 16 self.training_model, self.encoder, self.decoder = self._build_model()
17 self.load_weights(PREDICTION_MODEL_WEIGHTS_PATH)
18
~/anaconda3/lib/python3.7/site-packages/big_phoney/prediction_model.py in _build_model(self)
73 phone_embeddings = embedding_reshaper(phone_embeddings)
74
---> 75 context = get_context(encoder_outputs, h)
76 phone_and_context = context_phone_concat([context, phone_embeddings])
77 phone_and_context = context_phone_dense(phone_and_context)
~/anaconda3/lib/python3.7/site-packages/big_phoney/prediction_model.py in get_context(encoder_outputs, h_prev)
36 e = attn_dense2(e)
37 attention_weights = attn_softmax(e)
---> 38 context = attn_dot([attention_weights, encoder_outputs])
39 return context
40
~/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in call(self, *args, **kwargs)
950 if _in_functional_construction_mode(self, inputs, args, kwargs, input_list):
951 return self._functional_construction_call(inputs, args, kwargs,
--> 952 input_list)
953
954 # Maintains info about the
Layer.call
stack.~/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in _functional_construction_call(self, inputs, args, kwargs, input_list)
1089 # Check input assumptions set after layer building, e.g. input shape.
1090 outputs = self._keras_tensor_symbolic_call(
-> 1091 inputs, input_masks, args, kwargs)
1092
1093 if outputs is None:
~/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in _keras_tensor_symbolic_call(self, inputs, input_masks, args, kwargs)
820 return nest.map_structure(keras_tensor.KerasTensor, output_signature)
821 else:
--> 822 return self._infer_output_signature(inputs, args, kwargs, input_masks)
823
824 def _infer_output_signature(self, inputs, args, kwargs, input_masks):
~/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in _infer_output_signature(self, inputs, args, kwargs, input_masks)
860 # overridden).
861 # TODO(kaftan): do we maybe_build here, or have we already done it?
--> 862 self._maybe_build(inputs)
863 outputs = call_fn(inputs, *args, **kwargs)
864
~/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in _maybe_build(self, inputs)
2708 # operations.
2709 with tf_utils.maybe_init_scope(self):
-> 2710 self.build(input_shapes) # pylint:disable=not-callable
2711 # We must set also ensure that the layer is marked as built, and the build
2712 # shape is stored since user defined build functions may not be calling
~/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/utils/tf_utils.py in wrapper(instance, input_shape)
270 if input_shape is not None:
271 input_shape = convert_shapes(input_shape, to_tuples=True)
--> 272 output_shape = fn(instance, input_shape)
273 # Return shapes from
fn
as TensorShapes.274 if output_shape is not None:
~/anaconda3/lib/python3.7/site-packages/tensorflow/python/keras/layers/merge.py in build(self, input_shape)
678 '%s != %s. ' % (shape1[axes[0]], shape2[axes[1]]) +
679 'Layer shapes: %s, %s. ' % (shape1, shape2) +
--> 680 'Chosen axes: %s, %s' % (axes[0], axes[1]))
681
682 def _merge_function(self, inputs):
ValueError: Dimension incompatibility 20 != None. Layer shapes: (None, 20, 1), (None, None, 512). Chosen axes: 1, 1
`
The text was updated successfully, but these errors were encountered: