Google Colab无法从GCS Bucket中获取文件

问题描述

我正在尝试使用TPU训练repo的模型,该模型需要所有输入文件,并且模型目录必须使用云存储桶。

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

但是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_NAME = 'gs://my_xlnet_2'文件上传到存储桶中:

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

你们知道如何解决这个问题吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)