1
votes

I'm getting this error when I'm trying to access to run this code:

word_embedding_matrix = np.load(open("word_embedding_matrix.npy", 'rb'))

FileNotFoundError
Traceback (most recent call last) in () ----> 1 word_embedding_matrix = np.load(open("word_embedding_matrix.npy", 'rb'))

FileNotFoundError: [Errno 2] No such file or directory: 'word_embedding_matrix.npy'

1

1 Answers

0
votes

The most common reason for that is you didn't mount your google drive to your notebook. You can do that easily by running the following code in the first cell of your notebook:

import os
from google.colab import drive

drive.mount('/content/gdrive')
ROOT = "/content/gdrive/My Drive/"
os.chdir(ROOT)

This code enables your notebook to access your google drive and you can access your GoogleDrive the same as you do with your local disk. So, when you run os.listdir('.'), you should find word_embedding_matrix.npy among the returned items.

Source: official documentation