ludwig icon indicating copy to clipboard operation
ludwig copied to clipboard

KeyError: 'class_weights'

Open jiangweiatgithub opened this issue 2 years ago • 5 comments

I have trying to train an English-Chinese MT model, got the following issue: ludwig experiment --dataset alt_en-US_zh-CN_200k.tsv --config mt_en_sch.yaml Note: NumExpr detected 16 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8. NumExpr defaulting to 8 threads. ray.init() failed: Could not find any running Ray instance. Please specify the one to connect to by setting --address flag or RAY_ADDRESS environment variable. ███████████████████████ █ █ █ █ ▜█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ███ █ █ █ █ █ █ █ █ █ ▌ █ █ █████ █ █ █ █ █ █ █ █ █ █ ▟█ █ █ █ ███████████████████████ ludwig v0.5.3 - Experiment

╒════════════════════════╕ │ EXPERIMENT DESCRIPTION │ ╘════════════════════════╛

╒══════════════════╤════════════════════════════════════════════════════════════════════════════╕ │ Experiment name │ experiment │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ Model name │ run │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ Output directory │ D:\repos2\ludwig05\mt_01\results\experiment_run_7 │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ ludwig_version │ '0.5.3' │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ command │ ('D:\ProgramData\Anaconda3\envs\ludwig05\Scripts\ludwig experiment ' │ │ │ '--dataset alt_en-US_zh-CN_200k.tsv --config mt_en_sch.yaml') │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ random_seed │ 42 │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ dataset │ 'alt_en-US_zh-CN_200k.tsv' │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ data_format │ 'tsv' │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ torch_version │ '1.11.0+cu113' │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ compute │ {'gpu_type': 'Quadro RTX 5000', 'gpus_per_node': 1, 'num_nodes': 1} │ ╘══════════════════╧════════════════════════════════════════════════════════════════════════════╛

╒═══════════════╕ │ LUDWIG CONFIG │ ╘═══════════════╛

{ 'combiner': { 'activation': 'relu', 'bias_initializer': 'zeros', 'dropout': 0.0, 'fc_layers': None, 'flatten_inputs': False, 'norm': None, 'norm_params': None, 'num_fc_layers': 0, 'output_size': 256, 'residual': False, 'type': 'concat', 'use_bias': True, 'weights_initializer': 'xavier_uniform'}, 'input_features': [ { 'cell_type': 'lstm', 'column': 'English', 'encoder': 'rnn', 'name': 'English', 'preprocessing': { 'tokenizer': 'english_tokenize'}, 'proc_column': 'English_N2u1qg', 'reduce_output': None, 'tied': None, 'type': 'text'}], 'output_features': [ { 'attention': 'bahdanau', 'cell_type': 'lstm', 'column': 'Chinese', 'decoder': 'generator', 'dependencies': [], 'loss': { 'type': 'softmax_cross_entropy', 'unique': False}, 'name': 'Chinese', 'preprocessing': { 'missing_value_strategy': 'drop_row', 'tokenizer': 'characters'}, 'proc_column': 'Chinese_Pe0sb6', 'reduce_dependencies': 'sum', 'reduce_input': None, 'type': 'text'}], 'preprocessing': { 'audio': { 'audio_feature': { 'num_filter_bands': 80, 'type': 'fbank', 'window_length_in_s': 0.04, 'window_shift_in_s': 0.02}, 'audio_file_length_limit_in_s': 7.5, 'in_memory': True, 'missing_value_strategy': 'backfill', 'norm': None, 'padding_value': 0}, 'bag': { 'fill_value': '<UNK>', 'lowercase': False, 'missing_value_strategy': 'fill_with_const', 'most_common': 10000, 'tokenizer': 'space'}, 'binary': { 'missing_value_strategy': 'fill_with_false'}, 'category': { 'fill_value': '<UNK>', 'lowercase': False, 'missing_value_strategy': 'fill_with_const', 'most_common': 10000}, 'date': { 'datetime_format': None, 'fill_value': '', 'missing_value_strategy': 'fill_with_const'}, 'force_split': False, 'h3': { 'fill_value': 576495936675512319, 'missing_value_strategy': 'fill_with_const'}, 'image': { 'in_memory': True, 'infer_image_dimensions': True, 'infer_image_max_height': 256, 'infer_image_max_width': 256, 'infer_image_num_channels': True, 'infer_image_sample_size': 100, 'missing_value_strategy': 'backfill', 'num_processes': 1, 'resize_method': 'interpolate', 'scaling': 'pixel_normalization'}, 'number': { 'fill_value': 0, 'missing_value_strategy': 'fill_with_const', 'normalization': None}, 'oversample_minority': None, 'sample_ratio': 1.0, 'sequence': { 'fill_value': '<UNK>', 'lowercase': False, 'max_sequence_length': 256, 'missing_value_strategy': 'fill_with_const', 'most_common': 20000, 'padding': 'right', 'padding_symbol': '<PAD>', 'tokenizer': 'space', 'unknown_symbol': '<UNK>', 'vocab_file': None}, 'set': { 'fill_value': '<UNK>', 'lowercase': False, 'missing_value_strategy': 'fill_with_const', 'most_common': 10000, 'tokenizer': 'space'}, 'split_probabilities': (0.7, 0.1, 0.2), 'stratify': None, 'text': { 'fill_value': '<UNK>', 'lowercase': True, 'max_sequence_length': 256, 'missing_value_strategy': 'fill_with_const', 'most_common': 20000, 'padding': 'right', 'padding_symbol': '<PAD>', 'pretrained_model_name_or_path': None, 'tokenizer': 'space_punct', 'unknown_symbol': '<UNK>', 'vocab_file': None}, 'timeseries': { 'fill_value': '', 'missing_value_strategy': 'fill_with_const', 'padding': 'right', 'padding_value': 0, 'timeseries_length_limit': 256, 'tokenizer': 'space'}, 'undersample_majority': None, 'vector': { 'fill_value': '', 'missing_value_strategy': 'fill_with_const'}}, 'trainer': { 'batch_size': 96, 'checkpoints_per_epoch': 0, 'decay': False, 'decay_rate': 0.96, 'decay_steps': 10000, 'early_stop': 5, 'epochs': 100, 'eval_batch_size': None, 'evaluate_training_set': True, 'gradient_clipping': { 'clipglobalnorm': 0.5, 'clipnorm': None, 'clipvalue': None}, 'increase_batch_size_eval_metric': 'loss', 'increase_batch_size_eval_split': 'training', 'increase_batch_size_on_plateau': 0, 'increase_batch_size_on_plateau_max': 512, 'increase_batch_size_on_plateau_patience': 5, 'increase_batch_size_on_plateau_rate': 2.0, 'learning_rate': 0.001, 'learning_rate_scaling': 'linear', 'learning_rate_warmup_epochs': 1.0, 'optimizer': { 'amsgrad': False, 'betas': (0.9, 0.999), 'eps': 1e-08, 'lr': 0.001, 'type': 'adam', 'weight_decay': 0.0}, 'reduce_learning_rate_eval_metric': 'loss', 'reduce_learning_rate_eval_split': 'training', 'reduce_learning_rate_on_plateau': 0.0, 'reduce_learning_rate_on_plateau_patience': 5, 'reduce_learning_rate_on_plateau_rate': 0.5, 'regularization_lambda': 0.0, 'regularization_type': 'l2', 'should_shuffle': True, 'staircase': False, 'steps_per_checkpoint': 0, 'train_steps': None, 'validation_field': 'combined', 'validation_metric': 'loss'}}

╒═══════════════╕ │ PREPROCESSING │ ╘═══════════════╛

Using full raw dataset, no hdf5 and json file with the same name have been found Building dataset (it may take a while) Loading NLP pipeline Building dataset: DONE Writing preprocessed training set cache Writing preprocessed test set cache Writing preprocessed validation set cache Writing train set metadata

Dataset sizes: ╒════════════╤════════╕ │ Dataset │ Size │ ╞════════════╪════════╡ │ Training │ 137501 │ ├────────────┼────────┤ │ Validation │ 19670 │ ├────────────┼────────┤ │ Test │ 39446 │ ╘════════════╧════════╛

╒═══════╕ │ MODEL │ ╘═══════╛

Traceback (most recent call last): File "d:\programdata\anaconda3\envs\ludwig05\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\programdata\anaconda3\envs\ludwig05\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "D:\ProgramData\Anaconda3\envs\ludwig05\Scripts\ludwig.exe_main.py", line 7, in File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\cli.py", line 164, in main CLI() File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\cli.py", line 64, in init getattr(self, args.command)() File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\cli.py", line 84, in experiment experiment.cli(sys.argv[2:]) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\experiment.py", line 524, in cli experiment_cli(**vars(args)) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\experiment.py", line 240, in experiment_cli random_seed=random_seed, File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\api.py", line 1122, in experiment random_seed=random_seed, File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\api.py", line 493, in train update_config_with_metadata(self.config, training_set_metadata) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\features\feature_registries.py", line 100, in update_config_with_metadata feature.update_config_with_metadata(output_feature, training_set_metadata[output_feature[NAME]]) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\features\text_feature.py", line 289, in update_config_with_metadata if isinstance(output_feature[LOSS]["class_weights"], (list, tuple)): KeyError: 'class_weights'

jiangweiatgithub avatar Jun 30 '22 08:06 jiangweiatgithub

Hi @jiangweiatgithub, could you share the mt_en_sch.yaml file so that I can try to reproduce the error?

justinxzhao avatar Jul 05 '22 05:07 justinxzhao

Sure - input_features: - name: English type: text encoder: rnn cell_type: lstm reduce_output: null preprocessing: tokenizer: english_tokenize

output_features: - name: Chinese type: text decoder: generator cell_type: lstm attention: bahdanau reduce_input: null #loss: #type: softmax_cross_entropy preprocessing: tokenizer: chinese_tokenize

training: batch_size: 100

jiangweiatgithub avatar Jul 05 '22 14:07 jiangweiatgithub

@jiangweiatgithub thanks for sharing the yaml file. We're currently looking into this issue and trying to reproduce it. Are you also able to share alt_en-US_zh-CN_200k.tsv?

ShreyaR avatar Jul 25 '22 20:07 ShreyaR

@ShreyaR this doesn't seem like an issue that would be dataset-specific to me, though @jiangweiatgithub if we could get a small sample (i.e. head 10 lines), I'd be happy to confirm that dataset format is certainly not the culprit.

Small update on my side: I was not able to reproduce the issue using a toy text-to-text dataset locally. I suspect that this might be an issue specifically happening on GPUs.

justinxzhao avatar Jul 26 '22 00:07 justinxzhao

To update, it seems that this issue has been solved by the new release, though I start getting a new issue: ludwig05) D:\repos2\ludwig05\mt_01>ludwig experiment --dataset alt_en-US_zh-CN_200k.tsv --config mt_en_sch.yaml Note: NumExpr detected 16 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8. NumExpr defaulting to 8 threads. ray.init() failed: Could not find any running Ray instance. Please specify the one to connect to by setting --address flag or RAY_ADDRESS environment variable. ███████████████████████ █ █ █ █ ▜█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ███ █ █ █ █ █ █ █ █ █ ▌ █ █ █████ █ █ █ █ █ █ █ █ █ █ ▟█ █ █ █ ███████████████████████ ludwig v0.5.5 - Experiment

╒════════════════════════╕ │ EXPERIMENT DESCRIPTION │ ╘════════════════════════╛

╒══════════════════╤════════════════════════════════════════════════════════════════════════════╕ │ Experiment name │ experiment │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ Model name │ run │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ Output directory │ D:\repos2\ludwig05\mt_01\results\experiment_run_10 │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ ludwig_version │ '0.5.5' │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ command │ ('D:\ProgramData\Anaconda3\envs\ludwig05\Scripts\ludwig experiment ' │ │ │ '--dataset alt_en-US_zh-CN_200k.tsv --config mt_en_sch.yaml') │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ random_seed │ 42 │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ dataset │ 'alt_en-US_zh-CN_200k.tsv' │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ data_format │ 'tsv' │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ torch_version │ '1.11.0+cu113' │ ├──────────────────┼────────────────────────────────────────────────────────────────────────────┤ │ compute │ {'gpu_type': 'Quadro RTX 5000', 'gpus_per_node': 1, 'num_nodes': 1} │ ╘══════════════════╧════════════════════════════════════════════════════════════════════════════╛

╒═══════════════╕ │ LUDWIG CONFIG │ ╘═══════════════╛

{ 'combiner': { 'activation': 'relu', 'bias_initializer': 'zeros', 'dropout': 0.0, 'fc_layers': None, 'flatten_inputs': False, 'norm': None, 'norm_params': None, 'num_fc_layers': 0, 'output_size': 256, 'residual': False, 'type': 'concat', 'use_bias': True, 'weights_initializer': 'xavier_uniform'}, 'input_features': [ { 'cell_type': 'lstm', 'column': 'English', 'encoder': 'rnn', 'name': 'English', 'preprocessing': { 'tokenizer': 'english_tokenize'}, 'proc_column': 'English_N2u1qg', 'reduce_output': None, 'tied': None, 'type': 'text'}], 'output_features': [ { 'attention': 'bahdanau', 'cell_type': 'lstm', 'column': 'Chinese', 'decoder': 'generator', 'dependencies': [], 'loss': { 'class_similarities_temperature': 0, 'class_weights': 1, 'confidence_penalty': 0, 'robust_lambda': 0, 'type': 'sequence_softmax_cross_entropy', 'unique': False, 'weight': 1}, 'name': 'Chinese', 'preprocessing': { 'missing_value_strategy': 'drop_row', 'tokenizer': 'chinese_tokenize'}, 'proc_column': 'Chinese_ft_qtk', 'reduce_dependencies': 'sum', 'reduce_input': None, 'type': 'text'}], 'preprocessing': { 'audio': { 'audio_feature': { 'num_filter_bands': 80, 'type': 'fbank', 'window_length_in_s': 0.04, 'window_shift_in_s': 0.02}, 'audio_file_length_limit_in_s': 7.5, 'in_memory': True, 'missing_value_strategy': 'backfill', 'norm': None, 'padding_value': 0}, 'bag': { 'fill_value': '<UNK>', 'lowercase': False, 'missing_value_strategy': 'fill_with_const', 'most_common': 10000, 'tokenizer': 'space'}, 'binary': { 'missing_value_strategy': 'fill_with_false'}, 'category': { 'fill_value': '<UNK>', 'lowercase': False, 'missing_value_strategy': 'fill_with_const', 'most_common': 10000}, 'date': { 'datetime_format': None, 'fill_value': '', 'missing_value_strategy': 'fill_with_const'}, 'force_split': False, 'h3': { 'fill_value': 576495936675512319, 'missing_value_strategy': 'fill_with_const'}, 'image': { 'in_memory': True, 'infer_image_dimensions': True, 'infer_image_max_height': 256, 'infer_image_max_width': 256, 'infer_image_num_channels': True, 'infer_image_sample_size': 100, 'missing_value_strategy': 'backfill', 'num_processes': 1, 'resize_method': 'interpolate', 'scaling': 'pixel_normalization'}, 'number': { 'fill_value': 0, 'missing_value_strategy': 'fill_with_const', 'normalization': None}, 'oversample_minority': None, 'sample_ratio': 1.0, 'sequence': { 'fill_value': '<UNK>', 'lowercase': False, 'max_sequence_length': 256, 'missing_value_strategy': 'fill_with_const', 'most_common': 20000, 'padding': 'right', 'padding_symbol': '<PAD>', 'tokenizer': 'space', 'unknown_symbol': '<UNK>', 'vocab_file': None}, 'set': { 'fill_value': '<UNK>', 'lowercase': False, 'missing_value_strategy': 'fill_with_const', 'most_common': 10000, 'tokenizer': 'space'}, 'split_probabilities': (0.7, 0.1, 0.2), 'stratify': None, 'text': { 'fill_value': '<UNK>', 'lowercase': True, 'max_sequence_length': 256, 'missing_value_strategy': 'fill_with_const', 'most_common': 20000, 'padding': 'right', 'padding_symbol': '<PAD>', 'pretrained_model_name_or_path': None, 'tokenizer': 'space_punct', 'unknown_symbol': '<UNK>', 'vocab_file': None}, 'timeseries': { 'fill_value': '', 'missing_value_strategy': 'fill_with_const', 'padding': 'right', 'padding_value': 0, 'timeseries_length_limit': 256, 'tokenizer': 'space'}, 'undersample_majority': None, 'vector': { 'fill_value': '', 'missing_value_strategy': 'fill_with_const'}}, 'trainer': { 'batch_size': 100, 'checkpoints_per_epoch': 0, 'decay': False, 'decay_rate': 0.96, 'decay_steps': 10000, 'early_stop': 5, 'epochs': 100, 'eval_batch_size': None, 'evaluate_training_set': True, 'gradient_clipping': { 'clipglobalnorm': 0.5, 'clipnorm': None, 'clipvalue': None}, 'increase_batch_size_eval_metric': 'loss', 'increase_batch_size_eval_split': 'training', 'increase_batch_size_on_plateau': 0, 'increase_batch_size_on_plateau_max': 512, 'increase_batch_size_on_plateau_patience': 5, 'increase_batch_size_on_plateau_rate': 2.0, 'learning_rate': 0.001, 'learning_rate_scaling': 'linear', 'learning_rate_warmup_epochs': 1.0, 'optimizer': { 'amsgrad': False, 'betas': (0.9, 0.999), 'eps': 1e-08, 'lr': 0.001, 'type': 'adam', 'weight_decay': 0.0}, 'reduce_learning_rate_eval_metric': 'loss', 'reduce_learning_rate_eval_split': 'training', 'reduce_learning_rate_on_plateau': 0.0, 'reduce_learning_rate_on_plateau_patience': 5, 'reduce_learning_rate_on_plateau_rate': 0.5, 'regularization_lambda': 0.0, 'regularization_type': 'l2', 'should_shuffle': True, 'staircase': False, 'steps_per_checkpoint': 0, 'train_steps': None, 'validation_field': 'combined', 'validation_metric': 'loss'}}

╒═══════════════╕ │ PREPROCESSING │ ╘═══════════════╛

Found cached dataset and meta.json with the same filename of the dataset, but checksum don't match, if saving of processed input is not skipped they will be overridden Using full raw dataset, no hdf5 and json file with the same name have been found Building dataset (it may take a while) Loading NLP pipeline Loading NLP pipeline Building dataset: DONE Writing preprocessed training set cache Writing preprocessed test set cache Writing preprocessed validation set cache Writing train set metadata

Dataset sizes: ╒════════════╤════════╕ │ Dataset │ Size │ ╞════════════╪════════╡ │ Training │ 137501 │ ├────────────┼────────┤ │ Validation │ 19670 │ ├────────────┼────────┤ │ Test │ 39446 │ ╘════════════╧════════╛

╒═══════╕ │ MODEL │ ╘═══════╛

Warnings and other logs:

╒══════════╕ │ TRAINING │ ╘══════════╛

Training for 137600 step(s), approximately 100 epoch(s). Early stopping policy: 5 round(s) of evaluation, or 6880 step(s), approximately 5 epoch(s).

Starting with step 0, epoch: 0 Training: 1%|███▏ | 1376/137600 [1:17:20<123:51:35, 3.27s/it] Running evaluation for step: 1376, epoch: 0 Evaluation train: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 1375/1376 [07:22<00:00, 3.80it/s]d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\torchmetrics\aggregation.py:83: UserWarning: Encounted nan values in tensor. Will be removed. warnings.warn("Encounted nan values in tensor. Will be removed.", UserWarning) Evaluation train: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1376/1376 [07:23<00:00, 3.11it/s] Evaluation valid: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 197/197 [00:52<00:00, 3.77it/s] Evaluation test : 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 395/395 [01:48<00:00, 3.65it/s] ╒════════════╤════════╤══════════════════╕ │ Chinese │ loss │ token_accuracy │ ╞════════════╪════════╪══════════════════╡ │ train │ 7.2068 │ 0.1125 │ ├────────────┼────────┼──────────────────┤ │ validation │ 7.3114 │ 0.1056 │ ├────────────┼────────┼──────────────────┤ │ test │ 7.2788 │ 0.1082 │ ╘════════════╧════════╧══════════════════╛ ╒════════════╤════════╕ │ combined │ loss │ ╞════════════╪════════╡ │ train │ 7.2068 │ ├────────────┼────────┤ │ validation │ 7.3114 │ ├────────────┼────────┤ │ test │ 7.2788 │ ╘════════════╧════════╛ Validation loss on combined improved, model saved.

Training: 2%|██████▍ | 2752/137600 [2:46:17<90:58:09, 2.43s/it] Running evaluation for step: 2752, epoch: 1 Evaluation train: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1376/1376 [07:03<00:00, 3.25it/s] Evaluation valid: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 197/197 [00:56<00:00, 3.47it/s] Evaluation test : 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 395/395 [01:58<00:00, 3.33it/s] ╒════════════╤════════╤══════════════════╕ │ Chinese │ loss │ token_accuracy │ ╞════════════╪════════╪══════════════════╡ │ train │ 7.8774 │ 0.1134 │ ├────────────┼────────┼──────────────────┤ │ validation │ 8.0150 │ 0.1056 │ ├────────────┼────────┼──────────────────┤ │ test │ 7.9722 │ 0.1087 │ ╘════════════╧════════╧══════════════════╛ ╒════════════╤════════╕ │ combined │ loss │ ╞════════════╪════════╡ │ train │ 7.8774 │ ├────────────┼────────┤ │ validation │ 8.0150 │ ├────────────┼────────┤ │ test │ 7.9722 │ ╘════════════╧════════╛ Last improvement of combined validation loss happened 1376 step(s) ago.

Training: 3%|█████████▋ | 4128/137600 [4:15:44<89:52:20, 2.42s/it] Running evaluation for step: 4128, epoch: 2 Evaluation train: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1376/1376 [06:27<00:00, 3.55it/s] Evaluation valid: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 197/197 [00:59<00:00, 3.30it/s] Evaluation test : 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 395/395 [01:59<00:00, 3.31it/s] ╒════════════╤════════╤══════════════════╕ │ Chinese │ loss │ token_accuracy │ ╞════════════╪════════╪══════════════════╡ │ train │ 7.5391 │ 0.1138 │ ├────────────┼────────┼──────────────────┤ │ validation │ 7.6656 │ 0.1051 │ ├────────────┼────────┼──────────────────┤ │ test │ 7.6281 │ 0.1082 │ ╘════════════╧════════╧══════════════════╛ ╒════════════╤════════╕ │ combined │ loss │ ╞════════════╪════════╡ │ train │ 7.5391 │ ├────────────┼────────┤ │ validation │ 7.6656 │ ├────────────┼────────┤ │ test │ 7.6281 │ ╘════════════╧════════╛ Last improvement of combined validation loss happened 2752 step(s) ago.

Training: 4%|████████████▉ | 5504/137600 [5:42:47<89:07:52, 2.43s/it] Running evaluation for step: 5504, epoch: 3 Evaluation train: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1376/1376 [06:41<00:00, 3.43it/s] Evaluation valid: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 197/197 [00:57<00:00, 3.42it/s] Evaluation test : 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 395/395 [01:54<00:00, 3.45it/s] ╒════════════╤════════╤══════════════════╕ │ Chinese │ loss │ token_accuracy │ ╞════════════╪════════╪══════════════════╡ │ train │ 7.7374 │ 0.1138 │ ├────────────┼────────┼──────────────────┤ │ validation │ 7.8759 │ 0.1051 │ ├────────────┼────────┼──────────────────┤ │ test │ 7.8361 │ 0.1082 │ ╘════════════╧════════╧══════════════════╛ ╒════════════╤════════╕ │ combined │ loss │ ╞════════════╪════════╡ │ train │ 7.7374 │ ├────────────┼────────┤ │ validation │ 7.8759 │ ├────────────┼────────┤ │ test │ 7.8361 │ ╘════════════╧════════╛ Last improvement of combined validation loss happened 4128 step(s) ago.

Training: 5%|████████████████ | 6880/137600 [7:13:10<101:51:56, 2.81s/it] Running evaluation for step: 6880, epoch: 4 Evaluation train: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1376/1376 [06:42<00:00, 3.42it/s] Evaluation valid: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 197/197 [01:00<00:00, 3.28it/s] Evaluation test : 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 395/395 [01:53<00:00, 3.47it/s] ╒════════════╤════════╤══════════════════╕ │ Chinese │ loss │ token_accuracy │ ╞════════════╪════════╪══════════════════╡ │ train │ 7.7710 │ 0.1138 │ ├────────────┼────────┼──────────────────┤ │ validation │ 7.9111 │ 0.1051 │ ├────────────┼────────┼──────────────────┤ │ test │ 7.8711 │ 0.1082 │ ╘════════════╧════════╧══════════════════╛ ╒════════════╤════════╕ │ combined │ loss │ ╞════════════╪════════╡ │ train │ 7.7710 │ ├────────────┼────────┤ │ validation │ 7.9111 │ ├────────────┼────────┤ │ test │ 7.8711 │ ╘════════════╧════════╛ Last improvement of combined validation loss happened 5504 step(s) ago.

Training: 6%|███████████████████▎ | 8256/137600 [8:39:09<86:39:29, 2.41s/it] Running evaluation for step: 8256, epoch: 5 Evaluation train: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1376/1376 [06:23<00:00, 3.59it/s] Evaluation valid: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 197/197 [00:55<00:00, 3.58it/s] Evaluation test : 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 395/395 [01:51<00:00, 3.53it/s] ╒════════════╤════════╤══════════════════╕ │ Chinese │ loss │ token_accuracy │ ╞════════════╪════════╪══════════════════╡ │ train │ 7.8759 │ 0.1138 │ ├────────────┼────────┼──────────────────┤ │ validation │ 8.0223 │ 0.1051 │ ├────────────┼────────┼──────────────────┤ │ test │ 7.9795 │ 0.1082 │ ╘════════════╧════════╧══════════════════╛ ╒════════════╤════════╕ │ combined │ loss │ ╞════════════╪════════╡ │ train │ 7.8759 │ ├────────────┼────────┤ │ validation │ 8.0223 │ ├────────────┼────────┤ │ test │ 7.9795 │ ╘════════════╧════════╛ Last improvement of combined validation loss happened 6880 step(s) ago.

EARLY STOPPING due to lack of validation improvement. It has been 6880 step(s) since last validation improvement.

╒═════════════════╕ │ TRAINING REPORT │ ╘═════════════════╛

Best validation model step: 1376, epoch: 1 Best validation model loss on validation set combined: 7.311425685882568 Best validation model loss on test set combined: 7.278806209564209

Finished: experiment_run Saved to: D:\repos2\ludwig05\mt_01\results\experiment_run_10

╒══════════╕ │ FINISHED │ ╘══════════╛

Evaluation: 1%|██▌ | 3/395 [00:01<02:21, 2.78it/s]Traceback (most recent call last): File "d:\programdata\anaconda3\envs\ludwig05\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\programdata\anaconda3\envs\ludwig05\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "D:\ProgramData\Anaconda3\envs\ludwig05\Scripts\ludwig.exe_main.py", line 7, in File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\cli.py", line 164, in main CLI() File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\cli.py", line 64, in init getattr(self, args.command)() File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\cli.py", line 84, in experiment experiment.cli(sys.argv[2:]) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\experiment.py", line 524, in cli experiment_cli(**vars(args)) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\experiment.py", line 240, in experiment_cli random_seed=random_seed, File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\api.py", line 1156, in experiment return_type="dict", File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\api.py", line 904, in evaluate collect_predictions=collect_predictions or collect_overall_stats, File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\models\predictor.py", line 205, in batch_evaluation preds = self.model.evaluation_step(inputs, targets) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\models\ecd.py", line 195, in evaluation_step self.update_metrics(targets, predictions) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\models\ecd.py", line 255, in update_metrics of_obj.update_metrics(targets[of_name], predictions[of_name]) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\features\base_feature.py", line 384, in update_metrics metric_fn.update(predictions[prediction_key].detach(), targets) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\torchmetrics\metric.py", line 312, in wrapped_func update(*args, **kwargs) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\modules\metric_modules.py", line 214, in update self.avg.update(self.get_current_value(preds, target)) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\modules\metric_modules.py", line 378, in get_current_value return self.sequence_softmax_cross_entropy_function(preds, target) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\ludwig\modules\loss_modules.py", line 188, in forward return self.loss_fn(preds[1:].view(-1, preds.size(-1)), target[1:].view(-1)) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\torch\nn\modules\loss.py", line 1165, in forward label_smoothing=self.label_smoothing) File "d:\programdata\anaconda3\envs\ludwig05\lib\site-packages\torch\nn\functional.py", line 2996, in cross_entropy return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing) RuntimeError: CUDA out of memory. Tried to allocate 1.90 GiB (GPU 0; 16.00 GiB total capacity; 11.73 GiB already allocated; 450.75 MiB free; 13.67 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF Training: 6%|███████████████████▎ | 8256/137600 [8:48:22<137:57:56, 3.84s/it] Evaluation: 1%|██▌ | 3/395 [00:02<05:24, 1.21it/s]

jiangweiatgithub avatar Aug 09 '22 00:08 jiangweiatgithub

Hi @jiangweiatgithub, we just released v0.6, which addressed a handful of issues with Ray. Would you be able to try upgrading the version of Ludwig to see if the ray init issue has been fixed for you?

justinxzhao avatar Sep 29 '22 18:09 justinxzhao