jun seung
jun seung

Reputation: 21

Colab can't find a file

training_dataset_file = open('C:/Users/kbg04289/Desktop/mnist_train.csv', 'r')

I tried several methods like 'making address with \' and checking path.

Only google colab makes trouble, however jupyter notebook and visual studio code does well.

Upvotes: 2

Views: 12999

Answers (2)

Anonolobsto
Anonolobsto

Reputation: 1

You can easily upload files from your local drive to your google collab notebook directory by clicking the folder icon in the navigation panel to the left of your notebook and then dragging any file from your local directory into that navigation panel.

You will see a green check when it is finished and a warning that says "make sure the file is saved somewhere else. This file will be deleted when the notebook session is closed."

Click the folder icon, then drag your folder in

Upvotes: 0

Rayan Hatout
Rayan Hatout

Reputation: 640

Colab doesn't have access to your local drive.

from google.colab import files
uploaded_files = files.upload()

This will prompt you to upload a file to Colab and you'll then be able to do the following once the upload is complete:

training_dataset_file = open(uploaded_files['<filename>'], 'r')

Upvotes: 2

Related Questions