How to train BERT model with SQUAD 2.0 in Cloud TPU v2?
免责声明:我对神经网络和Tensorflow还是陌生的。
我正在尝试创建一个QA应用程序,其中用户提出问题,然后该应用程序给出答案。我尝试过的大多数传统方法都行不通,或者不够准确,或者需要人工干预。我正在研究无人监督的QA应用程序,也就是我遇到BERT的时候。
Google称
BERT是最先进的神经网络模型,在Squad 2.0的排行榜中获得最高分。我希望将这种模型用于我的应用程序并测试其性能。
我已经在Compute Engine中创建了Windows 2012 Datacenter版虚拟机。我已经使用ctpu创建了Cloud TPU。
我在Cloud Storage中有BERT大型无盒模型。
如何使用SQUAD 2.0训练BERT大型无盒模型?
如果我错了,请随时纠正我,我了解到Cloud TPU只是CPU或GPU之类的设备。但是,如果您阅读此书,他们将像Cloud TPU是一台虚拟机一样进行解释("在Cloud TPU上,您可以使用BERT-Large as ...来运行"。)
如此处所述,我在哪里运行run_squad.py?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | python run_squad.py \\ --vocab_file=$BERT_LARGE_DIR/vocab.txt \\ --bert_config_file=$BERT_LARGE_DIR/bert_config.json \\ --init_checkpoint=$BERT_LARGE_DIR/bert_model.ckpt \\ --do_train=True \\ --train_file=$SQUAD_DIR/train-v2.0.json \\ --do_predict=True \\ --predict_file=$SQUAD_DIR/dev-v2.0.json \\ --train_batch_size=24 \\ --learning_rate=3e-5 \\ --num_train_epochs=2.0 \\ --max_seq_length=384 \\ --doc_stride=128 \\ --output_dir=gs://some_bucket/squad_large/ \\ --use_tpu=True \\ --tpu_name=$TPU_NAME \\ --version_2_with_negative=True |
如何为此参数
外部IP地址是
因此TPU当前仅从GCS读取。您下载的模型应上传到您自己创建的另一个GCS存储桶中。这就是TPU将访问