Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在googlecolab中运行python参数_Python_Python 3.x_Google Colaboratory_Bert Language Model - Fatal编程技术网

在googlecolab中运行python参数

在googlecolab中运行python参数,python,python-3.x,google-colaboratory,bert-language-model,Python,Python 3.x,Google Colaboratory,Bert Language Model,我在GoogleColab中运行一个python文件,并得到一个错误。我下面是这个链接中的一个文本分类示例 https://appliedmachinelearning.blog/2019/03/04/state-of-the-art-text-classification-using-bert-model-predict-the-happiness-hackerearth-challenge/ 我按照所描述的教程进行了学习,现在是在colab中运行下面的代码片段的最后一步 python ru

我在GoogleColab中运行一个python文件,并得到一个错误。我下面是这个链接中的一个文本分类示例

https://appliedmachinelearning.blog/2019/03/04/state-of-the-art-text-classification-using-bert-model-predict-the-happiness-hackerearth-challenge/
我按照所描述的教程进行了学习,现在是在colab中运行下面的代码片段的最后一步

python run_classifier.py 
--task_name=cola 
--do_train=true 
--do_eval=true 
--do_predict=true 
--data_dir=./data/ 
--vocab_file=./cased_L-12_H-768_A-12/vocab.txt 
--bert_config_file=./cased_L-12_H-768_A-12/bert_config.json 
--init_checkpoint=./cased_L-12_H-768_A-12/bert_model.ckpt 
--max_seq_length=400 
--train_batch_size=8 
--learning_rate=2e-5 
--num_train_epochs=3.0 
--output_dir=./bert_output/ 
--do_lower_case=False
我知道在Colab中,我必须像这样运行python文件

!python run_classifier.py 

但是如何设置脚本中的其他参数呢。它克服了错误。谢谢您的帮助。

您应该在参数之间放置
\
符号。例如,您的代码是:

!python run_classifier.py \
--task_name=cola \
--do_train=true \
--do_eval=true \
--do_predict=true \
--data_dir=./data/ \
--vocab_file=./cased_L-12_H-768_A-12/vocab.txt \
--bert_config_file=./cased_L-12_H-768_A-12/bert_config.json \
--init_checkpoint=./cased_L-12_H-768_A-12/bert_model.ckpt \
--max_seq_length=400 \
--train_batch_size=8 \
--learning_rate=2e-5 \
--num_train_epochs=3.0 \
--output_dir=./bert_output/ \
--do_lower_case=False
这在另一个例子中对我有效