Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- python3 transformers/examples/tensorflow/language-modeling/run_mlm.py --model_name_or_path bert-base-cased --validation_split_percentage 20 --line_by_line --learning_rate 2e-5 --do_train --do_eval --per_device_train_batch_size 128 --per_device_eval_batch_size 256 --num_train_epochs 4 --output_dir output/ --train_file text.txt
- /usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (3.0.4) doesn't match a supported version!
- warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
- 2022-03-22 13:08:54.626798: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcublas.so.11'; dlerror: libcublas.so.11: cannot open shared object file: No such file or directory
- 2022-03-22 13:08:54.626886: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcublasLt.so.11'; dlerror: libcublasLt.so.11: cannot open shared object file: No such file or directory
- 2022-03-22 13:08:54.629258: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcusolver.so.11'; dlerror: libcusolver.so.11: cannot open shared object file: No such file or directory
- 2022-03-22 13:08:54.629317: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcusparse.so.11'; dlerror: libcusparse.so.11: cannot open shared object file: No such file or directory
- 2022-03-22 13:08:54.629361: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudnn.so.8'; dlerror: libcudnn.so.8: cannot open shared object file: No such file or directory
- 2022-03-22 13:08:54.629373: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1850] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
- Skipping registering GPU devices...
- 2022-03-22 13:08:54.629784: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA
- To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
- Using custom data configuration default-dae55bc4427ced66
- Reusing dataset text (/home/ftb16173/.cache/huggingface/datasets/text/default-dae55bc4427ced66/0.0.0/4b86d314f7236db91f0a0f5cda32d4375445e64c5eda2692655dd99c2dac68e8)
- 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 115.39it/s]
- loading configuration file https://huggingface.co/bert-base-cased/resolve/main/config.json from cache at /home/ftb16173/.cache/huggingface/transformers/a803e0468a8fe090683bdc453f4fac622804f49de86d7cecaee92365d4a0f829.a64a22196690e0e82ead56f388a3ef3a50de93335926ccfa20610217db589307
- Model config BertConfig {
- "architectures": [
- "BertForMaskedLM"
- ],
- "attention_probs_dropout_prob": 0.1,
- "classifier_dropout": null,
- "gradient_checkpointing": false,
- "hidden_act": "gelu",
- "hidden_dropout_prob": 0.1,
- "hidden_size": 768,
- "initializer_range": 0.02,
- "intermediate_size": 3072,
- "layer_norm_eps": 1e-12,
- "max_position_embeddings": 512,
- "model_type": "bert",
- "num_attention_heads": 12,
- "num_hidden_layers": 12,
- "pad_token_id": 0,
- "position_embedding_type": "absolute",
- "transformers_version": "4.12.5",
- "type_vocab_size": 2,
- "use_cache": true,
- "vocab_size": 28996
- }
- loading configuration file https://huggingface.co/bert-base-cased/resolve/main/config.json from cache at /home/ftb16173/.cache/huggingface/transformers/a803e0468a8fe090683bdc453f4fac622804f49de86d7cecaee92365d4a0f829.a64a22196690e0e82ead56f388a3ef3a50de93335926ccfa20610217db589307
- Model config BertConfig {
- "architectures": [
- "BertForMaskedLM"
- ],
- "attention_probs_dropout_prob": 0.1,
- "classifier_dropout": null,
- "gradient_checkpointing": false,
- "hidden_act": "gelu",
- "hidden_dropout_prob": 0.1,
- "hidden_size": 768,
- "initializer_range": 0.02,
- "intermediate_size": 3072,
- "layer_norm_eps": 1e-12,
- "max_position_embeddings": 512,
- "model_type": "bert",
- "num_attention_heads": 12,
- "num_hidden_layers": 12,
- "pad_token_id": 0,
- "position_embedding_type": "absolute",
- "transformers_version": "4.12.5",
- "type_vocab_size": 2,
- "use_cache": true,
- "vocab_size": 28996
- }
- loading file https://huggingface.co/bert-base-cased/resolve/main/vocab.txt from cache at /home/ftb16173/.cache/huggingface/transformers/6508e60ab3c1200bffa26c95f4b58ac6b6d95fba4db1f195f632fa3cd7bc64cc.437aa611e89f6fc6675a049d2b5545390adbc617e7d655286421c191d2be2791
- loading file https://huggingface.co/bert-base-cased/resolve/main/tokenizer.json from cache at /home/ftb16173/.cache/huggingface/transformers/226a307193a9f4344264cdc76a12988448a25345ba172f2c7421f3b6810fddad.3dab63143af66769bbb35e3811f75f7e16b2320e12b7935e216bd6159ce6d9a6
- loading file https://huggingface.co/bert-base-cased/resolve/main/added_tokens.json from cache at None
- loading file https://huggingface.co/bert-base-cased/resolve/main/special_tokens_map.json from cache at None
- loading file https://huggingface.co/bert-base-cased/resolve/main/tokenizer_config.json from cache at /home/ftb16173/.cache/huggingface/transformers/ec84e86ee39bfe112543192cf981deebf7e6cbe8c91b8f7f8f63c9be44366158.ec5c189f89475aac7d8cbd243960a0655cfadc3d0474da8ff2ed0bf1699c2a5f
- loading configuration file https://huggingface.co/bert-base-cased/resolve/main/config.json from cache at /home/ftb16173/.cache/huggingface/transformers/a803e0468a8fe090683bdc453f4fac622804f49de86d7cecaee92365d4a0f829.a64a22196690e0e82ead56f388a3ef3a50de93335926ccfa20610217db589307
- Model config BertConfig {
- "architectures": [
- "BertForMaskedLM"
- ],
- "attention_probs_dropout_prob": 0.1,
- "classifier_dropout": null,
- "gradient_checkpointing": false,
- "hidden_act": "gelu",
- "hidden_dropout_prob": 0.1,
- "hidden_size": 768,
- "initializer_range": 0.02,
- "intermediate_size": 3072,
- "layer_norm_eps": 1e-12,
- "max_position_embeddings": 512,
- "model_type": "bert",
- "num_attention_heads": 12,
- "num_hidden_layers": 12,
- "pad_token_id": 0,
- "position_embedding_type": "absolute",
- "transformers_version": "4.12.5",
- "type_vocab_size": 2,
- "use_cache": true,
- "vocab_size": 28996
- }
- Loading cached processed dataset at /home/ftb16173/.cache/huggingface/datasets/text/default-dae55bc4427ced66/0.0.0/4b86d314f7236db91f0a0f5cda32d4375445e64c5eda2692655dd99c2dac68e8/cache-f9836466676a2e42.arrow
- loading weights file https://huggingface.co/bert-base-cased/resolve/main/tf_model.h5 from cache at /home/ftb16173/.cache/huggingface/transformers/01800f4158e284e2447020e0124bc3f6aea3ac49848e744594f7cce8ee5ac0a4.a7137b2090d9302d722735af604b4c142ec9d1bfc31be7cbbe230aea9d5cfb76.h5
- All model checkpoint layers were used when initializing TFBertForMaskedLM.
- All the layers of TFBertForMaskedLM were initialized from the model checkpoint at bert-base-cased.
- If your task is similar to the task the model of the checkpoint was trained on, you can already use TFBertForMaskedLM for predictions without further training.
- No loss specified in compile() - the model's internal loss computation will be used as the loss. Don't panic - this is a common way to train TensorFlow models in Transformers! Please ensure your labels are passed as the 'labels' key of the input dict so that they are accessible to the model during the forward pass. To disable this behaviour, please pass a loss argument, or explicitly pass loss=None if you do not want your model to compute a loss.
- 2022-03-22 13:09:05.252479: W tensorflow/core/framework/dataset.cc:768] Input of GeneratorDatasetOp::Dataset will not be optimized because the dataset does not implement the AsGraphDefInternal() method needed to apply optimizations.
- Epoch 1/4
- Traceback (most recent call last):
- File "transformers/examples/tensorflow/language-modeling/run_mlm.py", line 561, in <module>
- main()
- File "transformers/examples/tensorflow/language-modeling/run_mlm.py", line 531, in main
- history = model.fit(
- File "/home/ftb16173/.local/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler
- raise e.with_traceback(filtered_tb) from None
- File "/home/ftb16173/.local/lib/python3.8/site-packages/tensorflow/python/framework/func_graph.py", line 1147, in autograph_handler
- raise e.ag_error_metadata.to_exception(e)
- TypeError: in user code:
- File "/home/ftb16173/.local/lib/python3.8/site-packages/keras/engine/training.py", line 1021, in train_function *
- return step_function(self, iterator)
- File "/home/ftb16173/.local/lib/python3.8/site-packages/keras/engine/training.py", line 1010, in step_function **
- outputs = model.distribute_strategy.run(run_step, args=(data,))
- File "/home/ftb16173/.local/lib/python3.8/site-packages/keras/engine/training.py", line 1000, in run_step **
- outputs = model.train_step(data)
- File "/home/ftb16173/.local/lib/python3.8/site-packages/transformers/modeling_tf_utils.py", line 796, in train_step
- y_pred = self(x, training=True)
- File "/home/ftb16173/.local/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler
- raise e.with_traceback(filtered_tb) from None
- TypeError: Exception encountered when calling layer "tf_bert_for_masked_lm" (type TFBertForMaskedLM).
- in user code:
- File "/home/ftb16173/.local/lib/python3.8/site-packages/transformers/models/bert/modeling_tf_bert.py", line 1394, in call *
- loss = (
- TypeError: compute_loss() got an unexpected keyword argument 'labels'
- Call arguments received:
- • input_ids={'input_ids': 'tf.Tensor(shape=(128, None), dtype=int64)', 'token_type_ids': 'tf.Tensor(shape=(128, None), dtype=int64)', 'attention_mask': 'tf.Tensor(shape=(128, None), dtype=int64)', 'labels': 'tf.Tensor(shape=(128, None), dtype=int64)'}
- • attention_mask=None
- • token_type_ids=None
- • position_ids=None
- • head_mask=None
- • inputs_embeds=None
- • output_attentions=None
- • output_hidden_states=None
- • return_dict=None
- • labels=None
- • training=True
- • kwargs=<class 'inspect._empty'>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement