Reputation: 193
I just found a problem about directory making on Colab.
First, I checked the current working directory:
import os
!pwd
>> /content/
Then, I created a sub-directory and checked it as follows.
data_path = '/content/kaggle_original_data_cats_dogs'
!mkdir data_path
!ls /content/
>> adc.json datalab data_path sample_data sampleSubmission.csv train.zip
Here, we can see that data_path is the third member of /content/.
However, when I tried to change the working directory to data_path, I got:
os.chdir(data_path)
>> FileNotFoundError: [Errno 2] No such file or directory: '/content/kaggle_original_data_cats_dogs'
So far...I can't figure out what just happened? Is there anything wrong with the lines above?
Upvotes: 0
Views: 8303
Reputation: 40928
The mistake is here
!mkdir data_path
It should be this instead:
!mkdir $data_path
Upvotes: 2