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

Tts_handel = UnetTTS(models_and_params, text2id_mapper, feats_yaml) 报错 #7

Open
xiaocao666tzh opened this issue Feb 23, 2022 · 2 comments

Comments

@xiaocao666tzh
Copy link

环境:Google Colab 使用GPU,使用官方文档的notebook
运行到Tts_handel = UnetTTS(models_and_params, text2id_mapper, feats_yaml)报错

UnknownError                              Traceback (most recent call last)
[<ipython-input-16-2776df11a7fe>](https://localhost:8080/#) in <module>()
----> 1 Tts_handel = UnetTTS(models_and_params, text2id_mapper, feats_yaml)

23 frames
[/content/One-Shot-Voice-Cloning/UnetTTS_syn.py](https://localhost:8080/#) in __init__(self, models_and_params, text2id_mapper, feats_yaml)
     22         self.phone_dur_min          = 5
     23         self.phone_dur_max          = 20
---> 24         self.__init_models()
     25 
     26     def one_shot_TTS(self, text, src_audio, duration_stats=None, is_wrap_txt=True):

[/content/One-Shot-Voice-Cloning/UnetTTS_syn.py](https://localhost:8080/#) in __init_models(self)
     72         self.duration_model = TFAutoModel.from_pretrained(config=AutoConfig.from_pretrained(self.models_and_params["duration_param"]), 
     73                                       pretrained_path=self.models_and_params["duration_model"],
---> 74                                       name="Normalized_duration_predictor")
     75         print("duration model load finished.")
     76 

[/usr/local/lib/python3.7/dist-packages/tensorflow_tts/inference/auto_model.py](https://localhost:8080/#) in from_pretrained(cls, config, pretrained_path, **kwargs)
     59                 model = model_class(config=config, **kwargs)
     60                 if is_build:
---> 61                     model._build()
     62                 if pretrained_path is not None and ".h5" in pretrained_path:
     63                     model.load_weights(pretrained_path)

[/usr/local/lib/python3.7/dist-packages/tensorflow_tts/models/unetts.py](https://localhost:8080/#) in _build(self)
     55         char_ids = tf.convert_to_tensor([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], tf.int32)
     56         duration_stat = tf.convert_to_tensor([[1., 1., 1., 1.]], tf.float32)
---> 57         self(char_ids, duration_stat)
     58 
     59     def call(

[/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py](https://localhost:8080/#) in __call__(self, *args, **kwargs)
   1035         with autocast_variable.enable_auto_cast_variables(
   1036             self._compute_dtype_object):
-> 1037           outputs = call_fn(inputs, *args, **kwargs)
   1038 
   1039         if self._activity_regularizer:

[/usr/local/lib/python3.7/dist-packages/tensorflow_tts/models/unetts.py](https://localhost:8080/#) in call(self, char_ids, duration_stat, training, **kwargs)
     72         embedding_output = self.embeddings(char_ids)
     73 
---> 74         encoder_output             = self.encoder([embedding_output, attention_mask], training=training)
     75         last_encoder_hidden_states = encoder_output[0]
     76 

[/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py](https://localhost:8080/#) in __call__(self, *args, **kwargs)
   1035         with autocast_variable.enable_auto_cast_variables(
   1036             self._compute_dtype_object):
-> 1037           outputs = call_fn(inputs, *args, **kwargs)
   1038 
   1039         if self._activity_regularizer:

[/usr/local/lib/python3.7/dist-packages/tensorflow_tts/models/moduls/core.py](https://localhost:8080/#) in call(self, inputs, training)
    377 
    378             layer_outputs = layer_module(
--> 379                 [hidden_states, attention_mask], training=training
    380             )
    381             hidden_states = layer_outputs[0]

[/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py](https://localhost:8080/#) in __call__(self, *args, **kwargs)
   1035         with autocast_variable.enable_auto_cast_variables(
   1036             self._compute_dtype_object):
-> 1037           outputs = call_fn(inputs, *args, **kwargs)
   1038 
   1039         if self._activity_regularizer:

[/usr/local/lib/python3.7/dist-packages/tensorflow_tts/models/moduls/core.py](https://localhost:8080/#) in call(self, inputs, training)
    339         attention_output = attention_outputs[0]
    340         intermediate_output = self.intermediate(
--> 341             [attention_output, attention_mask], training=training
    342         )
    343         layer_output = self.bert_output(

[/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py](https://localhost:8080/#) in __call__(self, *args, **kwargs)
   1035         with autocast_variable.enable_auto_cast_variables(
   1036             self._compute_dtype_object):
-> 1037           outputs = call_fn(inputs, *args, **kwargs)
   1038 
   1039         if self._activity_regularizer:

[/usr/local/lib/python3.7/dist-packages/tensorflow_tts/models/moduls/core.py](https://localhost:8080/#) in call(self, inputs)
    290         hidden_states, attention_mask = inputs
    291 
--> 292         hidden_states = self.conv1d_1(hidden_states)
    293         hidden_states = self.intermediate_act_fn(hidden_states)
    294         hidden_states = self.conv1d_2(hidden_states)

[/usr/local/lib/python3.7/dist-packages/keras/engine/base_layer.py](https://localhost:8080/#) in __call__(self, *args, **kwargs)
   1035         with autocast_variable.enable_auto_cast_variables(
   1036             self._compute_dtype_object):
-> 1037           outputs = call_fn(inputs, *args, **kwargs)
   1038 
   1039         if self._activity_regularizer:

[/usr/local/lib/python3.7/dist-packages/keras/layers/convolutional.py](https://localhost:8080/#) in call(self, inputs)
    247       inputs = tf.pad(inputs, self._compute_causal_padding(inputs))
    248 
--> 249     outputs = self._convolution_op(inputs, self.kernel)
    250 
    251     if self.use_bias:

[/usr/local/lib/python3.7/dist-packages/tensorflow/python/util/dispatch.py](https://localhost:8080/#) in wrapper(*args, **kwargs)
    204     """Call target, and fall back on dispatchers if there is a TypeError."""
    205     try:
--> 206       return target(*args, **kwargs)
    207     except (TypeError, ValueError):
    208       # Note: convert_to_eager_tensor currently raises a ValueError, not a

[/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/nn_ops.py](https://localhost:8080/#) in convolution_v2(input, filters, strides, padding, data_format, dilations, name)
   1136       data_format=data_format,
   1137       dilations=dilations,
-> 1138       name=name)
   1139 
   1140 

[/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/nn_ops.py](https://localhost:8080/#) in convolution_internal(input, filters, strides, padding, data_format, dilations, name, call_from_convolution, num_spatial_dims)
   1266           data_format=data_format,
   1267           dilations=dilations,
-> 1268           name=name)
   1269     else:
   1270       if channel_index == 1:

[/usr/local/lib/python3.7/dist-packages/tensorflow/python/util/dispatch.py](https://localhost:8080/#) in wrapper(*args, **kwargs)
    204     """Call target, and fall back on dispatchers if there is a TypeError."""
    205     try:
--> 206       return target(*args, **kwargs)
    207     except (TypeError, ValueError):
    208       # Note: convert_to_eager_tensor currently raises a ValueError, not a

[/usr/local/lib/python3.7/dist-packages/tensorflow/python/util/deprecation.py](https://localhost:8080/#) in new_func(*args, **kwargs)
    615                   func.__module__, arg_name, arg_value, 'in a future version'
    616                   if date is None else ('after %s' % date), instructions)
--> 617       return func(*args, **kwargs)
    618 
    619     doc = _add_deprecated_arg_value_notice_to_docstring(

[/usr/local/lib/python3.7/dist-packages/tensorflow/python/util/deprecation.py](https://localhost:8080/#) in new_func(*args, **kwargs)
    615                   func.__module__, arg_name, arg_value, 'in a future version'
    616                   if date is None else ('after %s' % date), instructions)
--> 617       return func(*args, **kwargs)
    618 
    619     doc = _add_deprecated_arg_value_notice_to_docstring(

[/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/nn_ops.py](https://localhost:8080/#) in conv1d(value, filters, stride, padding, use_cudnn_on_gpu, data_format, name, input, dilations)
   2009           data_format=data_format,
   2010           dilations=dilations,
-> 2011           name=name)
   2012     else:
   2013       result = squeeze_batch_dims(

[/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py](https://localhost:8080/#) in conv2d(input, filter, strides, padding, use_cudnn_on_gpu, explicit_paddings, data_format, dilations, name)
    930       return _result
    931     except _core._NotOkStatusException as e:
--> 932       _ops.raise_from_not_ok_status(e, name)
    933     except _core._FallbackException:
    934       pass

[/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py](https://localhost:8080/#) in raise_from_not_ok_status(e, name)
   6939   message = e.message + (" name: " + name if name is not None else "")
   6940   # pylint: disable=protected-access
-> 6941   six.raise_from(core._status_to_exception(e.code, message), None)
   6942   # pylint: enable=protected-access
   6943 

/usr/local/lib/python3.7/dist-packages/six.py in raise_from(value, from_value)

UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [Op:Conv2D]
@CMsmartvoice
Copy link
Owner

这可能是tensorflow版本 和 cuda版本不对应的问题。你试下下面的colab,一步步执行,就没有问题
https://colab.research.google.com/drive/1sEDvKTJCY7uosb7TvTqwyUdwNPiv3pBW?usp=sharing

@xiaocao666tzh
Copy link
Author

这可能是tensorflow版本 和 cuda版本不对应的问题。你试下下面的colab,一步步执行,就没有问题 https://colab.research.google.com/drive/1sEDvKTJCY7uosb7TvTqwyUdwNPiv3pBW?usp=sharing

谢谢大佬的notebook,这个可以正常运行。

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