Google Colab无法从GCS Bucket获取文件

2024-05-15 04:08:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图用TPU从这个repo训练一个模型,它需要所有的输入文件,并且模型目录必须使用云存储桶

我确实创建了一个bucket并上传了模型的所有文件

但是google colab无法读取我的桶的路径。这是我运行文件的命令:

!python run_coqa.py \
--use_tpu=True \
--tpu=TF_MASTER \ # 'grpc://'
--spiece_model_file=/content/xlnet_extension_tf/model/xlnet_cased_L-24_H-1024_A-16/spiece.model \
--model_config_path=gs://my_xlnet_2/xlnet_cased_L-24_H-1024_A-16/xlnet_config.json \
--init_checkpoint=gs://my_xlnet_2/xlnet_cased_L-24_H-1024_A-16/xlnet_model.ckpt \
--task_name=coqa \
--random_seed=100 \
--predict_tag=xxxxx \
--data_dir=/content/xlnet_extension_tf/data \
--output_dir=gs://my_xlnet_2/xlnet_output \
--model_dir=gs://my_xlnet_2/xlnet_output \
--export_dir=gs://my_xlnet_2/xlnet_output \
...

然后我得到了这个错误:

FileNotFoundError: [Errno 2] No such file or directory: 'gs://my_xlnet_2/xlnet_output'

我可以用这个命令将文件上传到我的bucket,BUCKET_NAME = 'gs://my_xlnet_2'

!gsutil mv /content/xlnet_extension_tf/model/xlnet_cased_L-24_H-1024_A-16 $BUCKET_NAME

你们知道怎么解决这个问题吗


Tags: 文件模型命令gsoutputmodelbucketmy

热门问题