From f3497bd4843c96765980e0ebe1a52140a5e055c0 Mon Sep 17 00:00:00 2001 From: benjas <909336740@qq.com> Date: Thu, 7 Jan 2021 13:03:42 +0800 Subject: [PATCH] Update README.md --- .../README.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/NLP通用框架BERT项目实战/Chapter 2——Interpretation and application examples of Bert source code/README.md b/NLP通用框架BERT项目实战/Chapter 2——Interpretation and application examples of Bert source code/README.md index ca5c8a8..88075cf 100644 --- a/NLP通用框架BERT项目实战/Chapter 2——Interpretation and application examples of Bert source code/README.md +++ b/NLP通用框架BERT项目实战/Chapter 2——Interpretation and application examples of Bert source code/README.md @@ -56,3 +56,48 @@ test.csv 推荐的pip方式是:pip --default-timeout=100 install 库名字 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com + + +#### 创建环境 + +~~~ +pip install tensorflow==1.13.2 -i https://pypi.douban.com/simple + +pip install numpy==1.16 -i https://pypi.douban.com/simple +~~~ + + + +参数 + +~~~ +-task_name=MRPC -do_train=true -do_eval=true -data_dir=../GLUE/glue_data/MRPC -vocab_file=../GLUE/BERT_BASE_DIR/uncased_L-12_H-768_A-12/vocab.txt -bert_config_file=../GLUE/BERT_BASE_DIR/uncased_L-12_H-768_A-12/bert_config.json -init_checkpoint=../GLUE/BERT_BASE_DIR/uncased_L-12_H-768_A-12/bert_model.ckpt -max_seq_length=128 -learning_rate=2e-5 -num_train_epochs=3.0 -output_dir=../GLUE/output/ +~~~ + + + +报错及解决办法 + +class AdamWeightDecayOptimizer(tf.optimizers.Optimizer): AttributeError: module 'tensorflow' has no attribute 'optimizers' + +> 如下内容 + +~~~ +tf.optimizers.Optimizer改为tf.keras.optimizers.Optimizer +~~~ + + + +super(AdamWeightDecayOptimizer, self).__init__(False, name) TypeError: __ini + +~~~ +super(AdamWeightDecayOptimizer, self).__init__(False, name) + 改成 +super(AdamWeightDecayOptimizer, self).__init__() +~~~ + + + +tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at save_restore_v2_ops.cc:109 : Not found: Failed to create a NewWriteableFile: + +> 路径过长,需要将整个项目移动到某盘下。要求满足:1.段路径,2.全英文 \ No newline at end of file