CLUEbenchmark / CLUE

中文语言理解测评基准 Chinese Language Understanding Evaluation Benchmark: datasets, baselines, pre-trained models, corpus and leaderboard
http://www.CLUEbenchmarks.com
4.02k stars 540 forks source link

bad variable name #41

Open Dwz101 opened 5 years ago

Dwz101 commented 5 years ago

您好 我在google colab 运行 models_pytorch/classifier_pytorch的脚本 提示报错“run_classifier_inews.sh: 2: export: Drive/Colab/CLUE-master/baselines/models_pytorch/classifier_pytorch/prev_trained_model/roberta_wwm_ext/: bad variable name” 这个错 是我配置的问题么

lonePatient commented 5 years ago

@Dwz101 您好,能否把完整的错误日志发下呢?但看这个无法看出什么问题。不知道colab跟正常的服务器运行环境有区别吗? 没有在colab实验过。

Dwz101 commented 5 years ago

@lonePatient 您好,谢谢您的回答。目前我这边的状况是这样🤣 1.由于我下载的tf的模型中没有checkpoint 导致我无法转pytorch成功,所以我直接下载pytorchzip 2.目前修改配置正常运行(train, eval)但是报如下错误: (venv) (base) DwzdeMacBook-Pro:classifier_pytorch dwz$ sh run_classifier_inews.sh /Users/dwz/CLUE/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) /Users/dwz/CLUE/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint8 = np.dtype([("quint8", np.uint8, 1)]) /Users/dwz/CLUE/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint16 = np.dtype([("qint16", np.int16, 1)]) /Users/dwz/CLUE/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_quint16 = np.dtype([("quint16", np.uint16, 1)]) /Users/dwz/CLUE/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)]) /Users/dwz/CLUE/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. np_resource = np.dtype([("resource", np.ubyte, 1)]) 12/04/2019 17:48:25 - WARNING - root - Process rank: -1, device: cpu, n_gpu: 0, distributed training: False, 16-bits training: False 12/04/2019 17:48:25 - INFO - transformers.configuration_utils - loading configuration file /Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base/bert_config.json 12/04/2019 17:48:25 - INFO - transformers.configuration_utils - Model config { "attention_probs_dropout_prob": 0.1, "directionality": "bidi", "finetuning_task": "inews", "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, "num_attention_heads": 12, "num_hidden_layers": 12, "num_labels": 3, "output_attentions": false, "output_hidden_states": false, "output_past": true, "pooler_fc_size": 768, "pooler_num_attention_heads": 12, "pooler_num_fc_layers": 3, "pooler_size_per_head": 128, "pooler_type": "first_token_transform", "pruned_heads": {}, "torchscript": false, "type_vocab_size": 2, "use_bfloat16": false, "vocab_size": 21128 }

12/04/2019 17:48:25 - INFO - transformers.tokenization_utils - Model name '/Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base' not found in model shortcut name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese, bert-base-german-cased, bert-large-uncased-whole-word-masking, bert-large-cased-whole-word-masking, bert-large-uncased-whole-word-masking-finetuned-squad, bert-large-cased-whole-word-masking-finetuned-squad, bert-base-cased-finetuned-mrpc, bert-base-german-dbmdz-cased, bert-base-german-dbmdz-uncased). Assuming '/Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base' is a path or url to a directory containing tokenizer files. 12/04/2019 17:48:25 - INFO - transformers.tokenization_utils - Didn't find file /Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base/added_tokens.json. We won't load it. 12/04/2019 17:48:25 - INFO - transformers.tokenization_utils - Didn't find file /Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base/special_tokens_map.json. We won't load it. 12/04/2019 17:48:25 - INFO - transformers.tokenization_utils - Didn't find file /Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base/tokenizer_config.json. We won't load it. 12/04/2019 17:48:25 - INFO - transformers.tokenization_utils - loading file /Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base/vocab.txt 12/04/2019 17:48:25 - INFO - transformers.tokenization_utils - loading file None 12/04/2019 17:48:25 - INFO - transformers.tokenization_utils - loading file None 12/04/2019 17:48:25 - INFO - transformers.tokenization_utils - loading file None 12/04/2019 17:48:25 - INFO - transformers.modeling_utils - loading weights file /Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base/pytorch_model.bin 12/04/2019 17:48:27 - INFO - transformers.modeling_utils - Weights of BertForSequenceClassification not initialized from pretrained model: ['classifier.weight', 'classifier.bias'] 12/04/2019 17:48:27 - INFO - transformers.modeling_utils - Weights from pretrained model not used in BertForSequenceClassification: ['cls.predictions.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.decoder.weight', 'cls.seq_relationship.weight', 'cls.seq_relationship.bias'] 12/04/2019 17:48:27 - INFO - root - Training/evaluation parameters Namespace(adam_epsilon=1e-08, cache_dir='', config_name='/Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base/bert_config.json', data_dir='/Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/chineseGLUEdatasets/inews/', device=device(type='cpu'), do_eval=True, do_lower_case=True, do_predict=False, do_train=True, eval_all_checkpoints=False, fp16=False, fp16_opt_level='O1', gradient_accumulation_steps=1, learning_rate=2e-05, local_rank=-1, logging_steps=670, max_grad_norm=1.0, max_seq_length=512, max_steps=-1, model_name_or_path='/Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/prev_trained_model/reberta_base', model_type='roberta', n_gpu=0, no_cuda=False, num_train_epochs=4.0, output_dir='/Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/outputs/inews_output/roberta', output_mode='classification', overwrite_cache=False, overwrite_output_dir=True, per_gpu_eval_batch_size=8, per_gpu_train_batch_size=8, save_steps=670, seed=42, server_ip='', server_port='', task_name='inews', tokenizer_name='', warmup_proportion=0.1, weight_decay=0.01) 12/04/2019 17:48:27 - INFO - root - Loading features from cached file /Users/dwz/CLUE/baselines/models_pytorch/classifier_pytorch/chineseGLUEdatasets/inews/cached_train_reberta_base_512_inews 12/04/2019 17:48:28 - INFO - root - Running training 12/04/2019 17:48:28 - INFO - root - Num examples = 5355 12/04/2019 17:48:28 - INFO - root - Num Epochs = 4 12/04/2019 17:48:28 - INFO - root - Instantaneous batch size per GPU = 8 12/04/2019 17:48:28 - INFO - root - Total train batch size (w. parallel, distributed & accumulation) = 8 12/04/2019 17:48:28 - INFO - root - Gradient Accumulation steps = 1 12/04/2019 17:48:28 - INFO - root - Total optimization steps = 2680 dyld: lazy symbol binding failed: Symbol not found: _PySlice_Unpack Referenced from: /Users/dwz/CLUE/venv/lib/python3.6/site-packages/torch/lib/libtorch_python.dylib Expected in: flat namespace

dyld: Symbol not found: _PySlice_Unpack Referenced from: /Users/dwz/CLUE/venv/lib/python3.6/site-packages/torch/lib/libtorch_python.dylib Expected in: flat namespace

run_classifier_inews.sh: line 36: 90741 Abort trap: 6 python run_classifier.py --model_type=roberta --model_name_or_path=$P_ROBERTA_WWM_DIR --task_name=$TASK_NAME --do_train --do_eval --do_lower_case --config_name=$P_ROBERTA_WWM_DIR/bert_config.json --data_dir=$GLUE_DIR/${TASK_NAME}/ --max_seq_length=512 --per_gpu_train_batch_size=8 --per_gpu_eval_batch_size=8 --learning_rate=2e-5 --num_train_epochs=4.0 --logging_steps=670 --save_steps=670 --output_dir=$OUTPUR_DIR/${TASK_NAME}_output/ --overwrite_output_dir

是因为我配置有问题么还是别的什么原因? 谢谢您百忙之中回复~~~