OS锛歶buntu16.04
cudatooklkit: 9.0
cudnn:7.1.2
tesnsorflow-gpu:1.8.0
When I run "python train.py" ,I got a TpyeError. What I have changed in Hparams file is tacotron_batch_size =16.
Have other people encountered this problem?
The log is below.
Wavenet Train
Checkpoint_path: logs-Tacotron-2/wave_pretrained/wavenet_model.ckpt
Loading training data from: tacotron_output/gta/map.txt
Using model: Tacotron-2
Hyperparameters:
allow_clipping_in_normalization: True
attention_dim: 128
attention_filters: 32
attention_kernel: (31,)
cbhg_conv_channels: 128
cbhg_highway_units: 128
cbhg_highwaynet_layers: 4
cbhg_kernels: 8
cbhg_pool_size: 2
cbhg_projection: 256
cbhg_projection_kernel_size: 3
cbhg_rnn_units: 128
cin_channels: 80
cleaners: english_cleaners
clip_mels_length: True
cross_entropy_pos_weight: 1
cumulative_weights: True
decoder_layers: 2
decoder_lstm_units: 1024
embedding_dim: 512
enc_conv_channels: 512
enc_conv_kernel_size: (5,)
enc_conv_num_layers: 3
encoder_lstm_units: 256
fmax: 7600
fmin: 55
frame_shift_ms: None
freq_axis_kernel_size: 3
gate_channels: 256
gin_channels: -1
griffin_lim_iters: 60
hop_size: 275
input_type: raw
kernel_size: 3
layers: 20
leaky_alpha: 0.4
log_scale_min: -32.23619130191664
log_scale_min_gauss: -7.0
mask_decoder: False
mask_encoder: False
max_abs_value: 4.0
max_iters: 2000
max_mel_frames: 1000
max_time_sec: None
max_time_steps: 11000
min_level_db: -100
n_fft: 2048
n_speakers: 5
natural_eval: False
normalize_for_wavenet: True
num_freq: 1025
num_mels: 80
out_channels: 2
outputs_per_step: 1
postnet_channels: 512
postnet_kernel_size: (5,)
postnet_num_layers: 5
power: 1.5
predict_linear: True
preemphasis: 0.97
preemphasize: True
prenet_layers: [256, 256]
quantize_channels: 65536
ref_level_db: 20
rescale: True
rescaling_max: 0.999
residual_channels: 128
sample_rate: 22050
signal_normalization: True
silence_threshold: 2
skip_out_channels: 128
smoothing: False
stacks: 2
stop_at_any: True
symmetric_mels: True
tacotron_adam_beta1: 0.9
tacotron_adam_beta2: 0.999
tacotron_adam_epsilon: 1e-06
tacotron_batch_size: 16
tacotron_clip_gradients: True
tacotron_data_random_state: 1234
tacotron_decay_learning_rate: True
tacotron_decay_rate: 0.4
tacotron_decay_steps: 50000
tacotron_dropout_rate: 0.5
tacotron_final_learning_rate: 1e-05
tacotron_initial_learning_rate: 0.001
tacotron_random_seed: 5339
tacotron_reg_weight: 1e-06
tacotron_scale_regularization: False
tacotron_start_decay: 50000
tacotron_swap_with_cpu: False
tacotron_synthesis_batch_size: 512
tacotron_teacher_forcing_decay_alpha: 0.0
tacotron_teacher_forcing_decay_steps: 280000
tacotron_teacher_forcing_final_ratio: 0.0
tacotron_teacher_forcing_init_ratio: 1.0
tacotron_teacher_forcing_mode: constant
tacotron_teacher_forcing_ratio: 1.0
tacotron_teacher_forcing_start_decay: 10000
tacotron_test_batches: 48
tacotron_test_size: None
tacotron_zoneout_rate: 0.1
train_with_GTA: True
trim_fft_size: 512
trim_hop_size: 128
trim_silence: True
trim_top_db: 23
upsample_activation: LeakyRelu
upsample_conditional_features: True
upsample_scales: [5, 5, 11]
upsample_type: 1D
use_bias: True
use_lws: False
use_speaker_embedding: True
wavenet_adam_beta1: 0.9
wavenet_adam_beta2: 0.999
wavenet_adam_epsilon: 1e-08
wavenet_batch_size: 8
wavenet_clip_gradients: False
wavenet_data_random_state: 1234
wavenet_decay_rate: 0.5
wavenet_decay_steps: 300000
wavenet_dropout: 0.05
wavenet_ema_decay: 0.9999
wavenet_init_scale: 1.0
wavenet_learning_rate: 0.0001
wavenet_lr_schedule: exponential
wavenet_random_seed: 5339
wavenet_swap_with_cpu: False
wavenet_synthesis_batch_size: 20
wavenet_test_batches: None
wavenet_test_size: 0.0441
wavenet_warmup: 4000.0
wavenet_weight_normalization: False
win_size: 1100
Initializing Wavenet model. Dimensions (? = dynamic shape):
Train mode: True
Eval mode: False
Synthesis mode: False
Traceback (most recent call last):
File "train.py", line 136, in
main()
File "train.py", line 130, in main
train(args, log_dir, hparams)
File "train.py", line 83, in train
checkpoint = wavenet_train(args, log_dir, hparams, input_path)
File "/mnt/sdb/Hayes/TTS/Tacotron-2/wavenet_vocoder/train.py", line 268, in wavenet_train
return train(log_dir, args, hparams, input_path)
File "/mnt/sdb/Hayes/TTS/Tacotron-2/wavenet_vocoder/train.py", line 175, in train
model, stats = model_train_mode(args, feeder, hparams, global_step)
File "/mnt/sdb/Hayes/TTS/Tacotron-2/wavenet_vocoder/train.py", line 123, in model_train_mode
feeder.input_lengths, x=feeder.inputs)
File "/mnt/sdb/Hayes/TTS/Tacotron-2/wavenet_vocoder/models/wavenet.py", line 219, in initialize
y_hat = self.step(x, c, g, softmax=False) #softmax is automatically computed inside softmax_cross_entropy if needed
File "/mnt/sdb/Hayes/TTS/Tacotron-2/wavenet_vocoder/models/wavenet.py", line 563, in step
x, h = conv(x, c, g_bct)
File "/mnt/sdb/Hayes/tools/yes/envs/Tacotron2/lib/python3.6/site-packages/tensorflow/python/keras/_impl/keras/engine/base_layer.py", line 318, in __call__
'This Layer takes an inputs argument to call(), and only the '
TypeError: This Layer takes an inputs argument to call(), and only the inputs argument may be specified as a positional argument. Pass everything else as a keyword argument (those arguments will not be tracked as inputs to the Layer).
(/mnt/sdb/Hayes/tools/yes/envs/Tacotron2) hayes@superpc-System-Product-Name:/mnt/sdb/Hayes/TTS/Tacotron-2$
There is keras-related-code in your source code.
You have created a keras Layer object, and called the layer without 'inputs' parameter. As I guess, you have changed the code to create convolution layer using keras. Not sure but you can check it. Good luck.
I also got the same problem.
My tools version:
python: 3.6.6
tf: 1.8.0-gpu
@woyebushiyaoshen I used an old version code to run without errors. The new code need to modify but I don't know how to fix it.
@woyebushiyaoshen I used an old version code to run without errors. The new code need to modify but I don't know how to fix it.
@Hayes515 can you show me the commit id of the old version? thanks.
I had the same exact problem, shame this bug was closed without resolution because I'd love to have known what the fix is. This is using the latest code of this repository unmodified from github. I wonder if the problem is to do with the fact that the precise version of Tensorflow and/or which version of Keras to use with this library does not appear to be specified.
I am getting this bug with
Keras 2.2.4
Tensorflow-gpu 1.8.0
and the current HEAD aka 970b0803bb41e68cbac854dc958dbb03f34f9604 of this library
@Hayes515 which version did you roll back to, to fix this error? Can you provide the git commit so we can compare ?
For reference of future people that stumble across this thread - this other comment is relevant. I upgraded to tensorflow-gpu 1.10.0 and now im getting a different error.
@mention The line is not illegal. The call function is a built-in function in 'tf.kera'. Try to replace the x with 'inputs'. It should be modified like below:
def call(self, inputs, c=None, g=None):
inputs, s, _ = self.step(inputs, c=c, g=g, is_incremental=False)
return [inputs, s]
And complete the parameters but not only the argument. For example the line should be modified like below:
x, h = conv(inputs=x, c=c, g=g_bct)
Most helpful comment
@mention The line is not illegal. The
callfunction is a built-in function in 'tf.kera'. Try to replace thexwith 'inputs'. It should be modified like below:And complete the parameters but not only the argument. For example the line should be modified like below: