Hello Fellow researchers,
Greetings ,
I tried to run multifeature with downsizing the embedding from 512 to 128 but I got an error stated below:
Traceback (most recent call last):
File “/opt/conda/envs/tf_v2_env/bin/onmt-main”, line 8, in
sys.exit(main())
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/bin/main.py”, line 189, in main
checkpoint_path=args.checkpoint_path)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/runner.py”, line 198, in train
mixed_precision=self._mixed_precision)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/training.py”, line 44, in init
self._model.create_variables()
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/models/model.py”, line 286, in create_variables
_ = self(features, labels=labels, training=True, step=0)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/models/model.py”, line 95, in call
return super(Model, self).call(*args, **kwargs)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py”, line 887, in call
self._maybe_build(inputs)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py”, line 2141, in _maybe_build
self.build(input_shapes)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/models/sequence_to_sequence.py”, line 141, in build
super(SequenceToSequence, self).build(input_shape)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/models/model.py”, line 89, in build
self.examples_inputter.build(input_shape)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/inputters/inputter.py”, line 342, in build
inputter.build(input_shape)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/inputters/inputter.py”, line 342, in build
inputter.build(input_shape)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/opennmt/inputters/text_inputter.py”, line 416, in build
trainable=self.trainable)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py”, line 522, in add_weight
aggregation=aggregation)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/base.py”, line 725, in _add_variable_with_custom_getter
name=name, shape=shape)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/base.py”, line 792, in _preload_simple_restoration
checkpoint_position=checkpoint_position, shape=shape)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/base.py”, line 75, in init
self.wrapped_value.set_shape(shape)
File “/opt/conda/envs/tf_v2_env/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py”, line 1074, in set_shape
(self.shape, shape))
ValueError: Tensor’s shape (94949, 512) is not compatible with supplied shape [94949, 128]
my model for multi_features_transformer’s function is (Indents are proper):
def model():
return onmt.models.Transformer(
source_inputter=onmt.inputters.ParallelInputter([
onmt.inputters.WordEmbedder(embedding_size=128),
onmt.inputters.WordEmbedder(embedding_size=16),
onmt.inputters.WordEmbedder(embedding_size=64)],
reducer=onmt.layers.ConcatReducer()),
target_inputter=onmt.inputters.WordEmbedder(embedding_size=128),
num_layers=6,
num_units=128,
num_heads=8,
ffn_inner_dim=2048,
dropout=0.1,
attention_dropout=0.1,
ffn_dropout=0.1)
Please help me resolve this issue. what is going wrong when I change the embedding size from 512 to 128
Thanks