0

I mounted the files from google drive correctly with the following code.

from google.colab import drive drive.mount('/content/gdrive') base_path = "/content/gdrive/MyDrive/Colab\ Notebooks/data" CAPUCHIN_FILE = os.path.join(base_path, 'Parsed_Capuchinbird_Clips', 'XC3776-3.wav') print(CAPUCHIN_FILE) # prints /content/gdrive/MyDrive/Colab\ Notebooks/data/Parsed_Capuchinbird_Clips/XC3776-3.wav 

My ls command proves that the file exists.

However, when trying to open it with Tensorflow-io, Colab notebook thinks it is not there.

What is happening here?

enter image description here

I have tried kernel restart and forced unmount. Still doesn't work.

1
  • fix your backslash.. Commented May 13, 2022 at 13:14

1 Answer 1

1

You have a backslash in your base_path. The ls command and Python's string handling might escape that backslash differently.

base_path = "/content/gdrive/MyDrive/Colab Notebooks/data" 
Sign up to request clarification or add additional context in comments.

1 Comment

Oh I see. I never thought string handling would be different for each language framework etc. Thank for pointing it out.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.