tensor2tensor
tensor2tensor copied to clipboard
AttributeError: 'HParams' object has no attribute 'audio_compression' - TIMIT dataset
TIMIT dataset - audio_timit_characters_test
- speech recognition
For the TIMIT data set, how to solve the audio_compression
error in training?
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/models/modalities.py", line 316, in bottom
for i in xrange(self._model_hparams.audio_compression):
AttributeError: 'HParams' object has no attribute 'audio_compression'
PROBLEM=audio_timit_characters_test
MODEL=transformer
HPARAMS=transformer_base
DATA_DIR=/mnt/f/audio_timit_characters_test/t2t_data
TMP_DIR=/mnt/f/audio_timit_characters_test/t2t_datagen
TRAIN_DIR=/mnt/f/audio_timit_characters_test/t2t_train/$PROBLEM/$MODEL-$HPARAMS
t2t-datagen --data_dir=$DATA_DIR --tmp_dir=$TMP_DIR --problem=$PROBLEM --timit_paths=/mnt/f/yongqiang_space/timit.tar
t2t-trainer --data_dir=$DATA_DIR --problems=$PROBLEM --model=$MODEL --hparams_set=$HPARAMS --output_dir=$TRAIN_DIR
1. Environment information
TIMIT dataset
tensorflow 1.4.1
python 2.7
2. Error logs
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/models/modalities.py", line 316, in bottom
for i in xrange(self._model_hparams.audio_compression):
AttributeError: 'HParams' object has no attribute 'audio_compression'
(tf_cpu_1.4.1_py2) yongqiang@yongqiang:~$ t2t-trainer --data_dir=/mnt/f/audio_timit_characters_test/t2t_data --problems=audio_timit_characters_test --model=transformer --hparams_set=transformer_base --output_dir=/mnt/f/audio_timit_characters_test/t2t_train/audio_timit_characters_test/transformer-transformer_base
INFO:tensorflow:Creating experiment, storing model files in /mnt/f/audio_timit_characters_test/t2t_train/audio_timit_characters_test/transformer-transformer_base
INFO:tensorflow:datashard_devices: ['gpu:0']
INFO:tensorflow:caching_devices: None
INFO:tensorflow:Using config: {'_model_dir': '/mnt/f/audio_timit_characters_test/t2t_train/audio_timit_characters_test/transformer-transformer_base', '_save_checkpoints_secs': 600, '_num_ps_replicas': 0, '_keep_checkpoint_max': 20, '_session_config': allow_soft_placement: true
graph_options {
optimizer_options {
}
}
, '_tf_random_seed': None, '_task_type': None, '_environment': 'local', '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fff98fe4f10>, '_tf_config': gpu_options {
per_process_gpu_memory_fraction: 1.0
}
, '_num_worker_replicas': 0, '_task_id': 0, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_evaluation_master': '', '_keep_checkpoint_every_n_hours': 10000, '_master': '', '_log_step_count_steps': 100}
INFO:tensorflow:Performing local training.
WARNING:tensorflow:From /home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/monitors.py:267: __init__ (from tensorflow.contrib.learn.python.learn.monitors) is deprecated and will be removed after 2016-12-05.
Instructions for updating:
Monitors are deprecated. Please use tf.train.SessionRunHook.
INFO:tensorflow:datashard_devices: ['gpu:0']
INFO:tensorflow:caching_devices: None
Traceback (most recent call last):
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/bin/t2t-trainer", line 83, in <module>
tf.app.run()
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/bin/t2t-trainer", line 79, in main
schedule=FLAGS.schedule)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/utils/trainer_utils.py", line 247, in run
run_locally(exp_fn(output_dir))
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/utils/trainer_utils.py", line 540, in run_locally
exp.train_and_evaluate()
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 625, in train_and_evaluate
self.train(delay_secs=0)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 367, in train
hooks=self._train_monitors + extra_hooks)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 812, in _call_train
monitors=hooks)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/python/util/deprecation.py", line 316, in new_func
return func(*args, **kwargs)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 480, in fit
loss = self._train_model(input_fn=input_fn, hooks=hooks)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 986, in _train_model
model_fn_ops = self._get_train_ops(features, labels)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1202, in _get_train_ops
return self._call_model_fn(features, labels, model_fn_lib.ModeKeys.TRAIN)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1166, in _call_model_fn
model_fn_results = self._model_fn(features, labels, **kwargs)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/utils/trainer_utils.py", line 432, in model_fn
len(hparams.problems) - 1)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/utils/trainer_utils.py", line 754, in _cond_on_index
return fn(cur_idx)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/utils/trainer_utils.py", line 413, in nth_model
features, skip=(skipping_is_on and skip_this_one))
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/utils/t2t_model.py", line 390, in model_fn
sharded_features[key], dp)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/utils/modality.py", line 91, in bottom_sharded
return data_parallelism(self.bottom, xs)
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/utils/expert_utils.py", line 294, in __call__
outputs.append(fns[i](*my_args[i], **my_kwargs[i]))
File "/home/yongqiang/miniconda3/envs/tf_cpu_1.4.1_py2/lib/python2.7/site-packages/tensor2tensor/models/modalities.py", line 316, in bottom
for i in xrange(self._model_hparams.audio_compression):
AttributeError: 'HParams' object has no attribute 'audio_compression'
(tf_cpu_1.4.1_py2) yongqiang@yongqiang:~$
@afrozenator Please give tips.