我正在使用Google Colab尝试将pickle文件加载到数组中。然而,它找不到我的数据路径。目前我的数据设置为:
/content/drive/My Drive/My Folder/Data/Storage/My Pickle Files/
我的驱动器被挂载到路径:
drive.mount('/content/drive')
我有一个pickle文件的数组,我正在尝试将它们加载到数组中,但似乎无法找到正确的路径来加载这些文件,我尝试使用下面描述的代码:
p_files = [
"content/drive/My Drive/My Folder/Data/Storage/My Pickle Files/pickles_1.pkl",
"content/drive/My Drive/My Folder/Data/Storage/My Pickle Files/pickles_2.pkl",
"content/drive/My Drive/My Folder/Data/Storage/My Pickle Files/pickles_3.pkl",
"content/drive/My Drive/My Folder/Data/Storage/My Pickle Files/pickles_4.pkl",
"content/drive/My Drive/My Folder/Data/Storage/My Pickle Files/pickles_5.pkl",
"content/drive/My Drive/My Folder/Data/Storage/My Pickle Files/pickles_6.pkl"
]
loaded_pickles = []
for p in p_files:
with open(p, 'rb') as file:
loaded_pickles.append(pickle.load(file))
我遇到了这个错误:
FileNotFoundError: [Errno 2] No such file or directory: 'content/drive/My Drive/My Folder/Data/Storage/My Pickle Files/pickles_1.pkl'