1

I am trying to load the Glove embedding vectors in kaggle kernel using TorchText lib.

from torchtext import vocab
vec = vocab.Vectors('glove.6B.100d.txt', '../input/glove6b100dtxt/')

I am getting the following error:

OSError: [Errno 30] Read-only file system: '../input/glove6b100dtxt/glove.6B.100d.txt.pt'

Adding screenshot for more clarification: enter image description here

4

1 回答 1

0

当您使用手套嵌入作为来自其他数据集的输入的一部分时,就会发生这种情况。您无权访问输入文件夹,因此解决方法如下:

现在我们将加载 Glove Embedding 并将其移出到工作目录

!cp -r ../input/glove-embeddings/ ../kaggle/working/glove-embeddings

移动后,更改访问位置

vec = vocab.Vectors('glove.6B.100d.txt', '../kaggle/working/glove-embeddings')
于 2021-12-29T05:18:10.673 回答