Hi fellas I'm working on a kaggle dataset and using colab + google drive combo, but somehow i cannot see any files/data in my gdrive its like invisible. i can see the path n all but the data is not there. can someone help me with this please?:)

here as you can see i can see the path for kaggle data but im not able to see the data.

Make sure your path is a subfolder of ‘/content/gdrive/’.

You can access your google drive with this path: ‘/content/gdrive’
The “Mounted at …” means exactly that.

However, the path you are accessing through Config.data_path()/‘planet’ points to ‘/root/.fastai/data’ which is basically the hard drive of the computer which executes your code.

1 Like

i got the mounting part… but after mounting the kaggle dataset which i have downloaded is not seen in my google drive.

im not seeing any files in my hard drive sir, i dont know where it is stored.
PS: I do not have anything in my hard drive i use gdrive for all my storage and even my notebook is stored in gdrive.

It should be in this path:
/content/gdrive/My Drive/

1 Like

Hi sorry i will bother you again, probably one last time!! (if its fixed) :P…

I tried searching all over internet but did not get any proper answer so im writing again…

Here as you said the data would be stored in the path “/content/gdrive/My Drive/”

but when i download from kaggle, it will be downloaded outside of gdrive (as you can see in the image i have marked) and i cannot access that data. how to access that folder outside of gdrive. or how to configure the kaggle download so it will be downloaded in the mentioned path ( “/content/gdrive/My Drive/” )

Thank you

Can’t you download manually from Kaggle and place it on your Google drive? Like this, it is quite easy to have full control where the files end up. It was my assumption you did that, after the first post.

1 Like

oh okey sorry i did not do that, i was such a noob… it fixed the problem. thanks @DeepBlender :slight_smile:

1 Like

No worries, we are all still learning!

Usually, I am not answering technical questions here, because I am not used enough to the fastai library. As I am used to Google Colab and Google Drive, I only had to check what I am doing in my code.
It is quite likely that there is a fastai way of doing it, which is fully automatic. That is outside of my comfort zone and others would need to help you with that.

1 Like

@DeepBlender actually there is an article in docs.fast.ai which explains the path problem which we can resolve by changing the config.yml file.

Link: https://docs.fast.ai/datasets.html

These are steps to dowwnload your Kaggle zip files to your Google Drive (My Drive):

  • Create your own folder in your Google Drive and let’s call it “severstal” (like in your example here above). So you wil have the “MyDrive/seversta” folder
  • In a Colab notebook, mount your Google Drive:
    from google.colab import drive
    drive.mount(’/content/gdrive’, force_remount=True)
  • In the subsequent cell, change the current directory to your Google Drive directory (this is the crutial step to download your own directory as opposed to the /.fasta/data directory located on the ephemeral Colab virtual machine)
    %cd /content/gdrive/My Drive/seversta
  • download your Kaggle zip file
    kaggle competitions download -c severstal-steel-defect-detection

Good luck,

Farid

3 Likes

@farid i tried it but no luck!!! did it work for you?? cus its not working for me…

run this following command before downloading
!chmod 600 /root/.kaggle/kaggle.json

and make sure that you use %cd and not !cd in the following command (you can copy and paste it)
%cd /content/gdrive/My Drive/seversta
The output cell should show the new path /content/gdrive/My Drive/seversta

3 Likes

@farid oh sorry it was my mistake, Now its working…it was very helpful… Thank you :slight_smile:

I’m glad it worked!

Good luck

1 Like

What is the difference between % and !?

Both are used to run unix commands from inside jupyter notebook

But if you try doing

!cd <mydir>

It doesn’t work since all UNIX commands in Jupyter run on a temporary subshell.

If you want to change directory, you need to use magic command

%cd <mydir>

In fact, you can even simply say without % sign

cd <mydir>

This is because of automagic function which is on by default.

2 Likes

Thank you PoonmaV :slight_smile:

i learnt something new