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

Failed to load dataset with sentence_piece model. #208

Open
kju196 opened this issue Jun 15, 2021 · 1 comment
Open

Failed to load dataset with sentence_piece model. #208

kju196 opened this issue Jun 15, 2021 · 1 comment

Comments

@kju196
Copy link

kju196 commented Jun 15, 2021

I tried to train the model with sentence_piece
Tensorflow 2.3.2 and cuda 10.1

python examples/deepspeech2/train.py --config config.yml --sentence_piece

But I got this error.

INFO:tensorflow:Reading /data/asr/train.tsv ...
Traceback (most recent call last):
  File "examples/deepspeech2/train.py", line 111, in <module>
    train_data_loader = train_dataset.create(global_batch_size)
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow_asr/datasets/asr_dataset.py", line 368, in create
    dataset = tf.data.Dataset.from_tensor_slices(self.entries)
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 682, in from_tensor_slices
    return TensorSliceDataset(tensors)
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 3001, in __init__
    element = structure.normalize_element(element)
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow/python/data/util/structure.py", line 115, in normalize_element
    ops.convert_to_tensor(t, name="component_%d" % i))
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 1499, in convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow/python/framework/tensor_conversion_registry.py", line 52, in _default_conversion_function
    return constant_op.constant(value, dtype, name=name)
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 263, in constant
    return _constant_impl(value, dtype, shape, name, verify_shape=False,
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 275, in _constant_impl
    return _constant_eager_impl(ctx, value, dtype, shape, verify_shape)
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 300, in _constant_eager_impl
    t = convert_to_eager_tensor(value, ctx, dtype)
  File "/data/anaconda3/envs/asr/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 98, in convert_to_eager_tensor
    return ops.EagerTensor(value, ctx.device_name, dtype)
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type list).

Could you give me a suggestion where I got a mistake?

@vivekyadav21
Copy link

vivekyadav21 commented Jun 23, 2021

@kju196 add this tf.config.run_functions_eagerly(True) to your code to enable eager execution.
may be this help you

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

2 participants