Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

vocab size error #27

Open
JejuWayfarer opened this issue Nov 17, 2020 · 0 comments
Open

vocab size error #27

JejuWayfarer opened this issue Nov 17, 2020 · 0 comments

Comments

@JejuWayfarer
Copy link

When the default vocav path of data/utils.py was changed to a 250,000 vocab and executed in colab. The Below error code occurred. an error presumed to be a vocab size mismatch occurred. How can it be solved?

my code

model_parallelism, train_batch_size, keep_checkpoint_max = (1, 256, 16)
model = t5.models.MtfModel(
model_dir = 'gs://mt5_wayfarer/small',
tpu=TPU_ADDRESS,
tpu_topology=TPU_TOPOLOGY,
model_parallelism=model_parallelism,
batch_size=train_batch_size,
)

question_1 = "Processed input: translate English to German: "Luigi often said to me that he never wanted the brothers to end up in court," she wrote." #@param {type:"string"}

questions = [question_1]

now = time.time()
predict_inputs_path = os.path.join(prediction_dir, "predict_inputs_%d.txt" % now)
predict_outputs_path = os.path.join(prediction_dir, "predict_outputs_%d.txt" % now)
with tf.io.gfile.GFile(predict_inputs_path, "w") as f:
for q in questions:
f.write(q.lower())

model.batch_size = 8 # Min size for small model on v2-8 with parallelism 1.
model.predict(
input_file=predict_inputs_path,
output_file=predict_outputs_path,
# Select the most probable output token at each step.
temperature=0,
)

error code

InvalidArgumentError: From /job:worker/replica:0/task:0:
9 root error(s) found.
(0) Invalid argument: Run-time shape mismatch for TPUExecute argument[90] (VarHandles_17697799040045632952/_2:88). Expected element_type: F32
dimensions: 512
dimensions: 250240
layout {
minor_to_major: 1
minor_to_major: 0
format: DENSE
}
is_dynamic_dimension: false
is_dynamic_dimension: false
; got element_type: F32
dimensions: 512
dimensions: 250112
layout {
minor_to_major: 1
minor_to_major: 0
format: DENSE
}
is_dynamic_dimension: false
is_dynamic_dimension: false

 [[node TPUReplicateMetadata (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/tpu/tpu_estimator.py:3697) ]]
 [[tpu_compile_succeeded_assert/_14841502660177317055/_3_G4826]]

(1) Invalid argument: Run-time shape mismatch for TPUExecute argument[90] (VarHandles_17697799040045632952/_2:88). Expected element_type: F32
dimensions: 512
dimensions: 250240
layout {
minor_to_major: 1
minor_to_major: 0
format: DENSE
}
is_dynamic_dimension: false
is_dynamic_dimension: false
; got element_type: F32
dimensions: 512
dimensions: 250112
layout {
minor_to_major: 1
minor_to_major: 0
format: DENSE
}
is_dynamic_dimension: false
is_dynamic_dimension: false

 [[node TPUReplicateMetadata (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_estimator/python/estimator/tpu/tpu_estimator.py:3697) ]]
 [[tpu_compile_succeeded_assert/_14841502660177317055/_3_G4816]]

(2) Invalid argument: Run-time shape mismatch for TPUExecute argument[90] (VarHandles_17697799040045632952/_2:88). Expected element_type: F32
dimensions: 512
dimensions: 250240
layout {
minor_to_major: 1
minor_to_major: 0
format: DENSE
}
is_dynamic_dimension: false
is_dynamic_dimension: false
; got element_type: F32
dimensions: 512
dimensions: 250112
layout {
minor_to_major: 1
minor_to_major: 0
format: DENSE
}
is_dynamic_dimension: false
is_dynamic_dimension: false

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant