跑步有困难快速.ai使用Google云数据实验室的imagelist

2024-04-23 15:53:54 发布

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

我正在使用谷歌数据实验室的Jupyter笔记本和谷歌云存储。我似乎无法让Imagelist在这种环境下工作。 我使用google colab和google drive运行了完全相同的代码,它运行得非常好,但使用数据实验室和存储就行不通了。你知道吗

Colab中的代码:

path = Path(’/gdrive/My Drive/ISIC_2019_data/’)
tfms = get_transforms(flip_vert=True, max_lighting=0.1, max_zoom=1.05, max_warp=0.2)
np.random.seed(42)
src = (ImageList.from_csv(path, ‘/gdrive/My Drive/ISIC_2019_data/truelabels.csv’, folder=‘ISIC_2019_Training_Input’, suffix=’.jpg’)
.split_by_rand_pct(0.2)
.label_from_df())

数据实验室中的代码:

path = Path(‘gs://involuted-shine-246019/ISIC_2019_Data/’)
tfms = get_transforms(flip_vert=True, max_lighting=0.1, max_zoom=1.05, max_warp=0.2)
np.random.seed(42)
src = (ImageList.from_csv(path, ‘gs://involuted-shine-246019/ISIC_2019_Data/truelabels.csv’, folder=‘ISIC_2019_Training_Input’, suffix=’.jpg’)
.split_by_rand_pct(0.2)
.label_from_df())

错误消息:

ValueError: Bad Request: https://www.googleapis.com/storage/v1/b/gs:/o/involuted-shine-246019%2FISIC_2019_Data%2Fgs:%2Finvoluted-shine-246019%2FISIC_2019_Data%2Ftruelabels.csv
Invalid bucket name: ‘gs:’

但是当我去掉gs时,它说没有这样的文件或目录存在。你知道吗


Tags: csv数据path代码fromgsmygoogle