Reputation: 4478
I am using Google Colaboratory & github.
I create a new Google Colab notebook, and I clone my github project into it using a simple !git clone <github_link>
in the notebook.
Now, I have a Jupyter notebook in my github project that I need to run on Google Colab. How do I do that?
Upvotes: 20
Views: 35948
Reputation: 438
It may be a new feature not mentioned in other answers. But right now Colab allows running jupyter notebooks directly from github, even from private repos.
colab.research.google.com
GitHub
tab.include private repository
if needed.And clone your repo from inside the opened notebook.
Upvotes: 1
Reputation: 1748
Upload the .ipynb file directly in colab. Just go to colab, in the tabs above there should be upload. choose the file and upload there.
Upvotes: 0
Reputation: 65
The better option I have found is copying the code from each cell and executing the code in colab, if you clone the Github and containing ipynb file in that. By doing this you won't face any difficulties.
Upvotes: 0
Reputation: 1
import sys, os
sys.path.append('models/research')
sys.path.append('models/research/object_detection')
It helped me. I was also looking for it, and found it in this COLAB work
https://colab.research.google.com/drive/1EQ3Lt_ez-oKTtVMebh6Tm3XSyPPOHAf3#scrollTo=oC-_mxCxCNP6
Upvotes: 0
Reputation: 7151
The two most practical ways are both through the Google Drive webinterface.
The first method is what @Korakot Choavavanich described. The advantage of this method is that it provides a Search window to search for your file in your google drive storage.
The second method is even more convenient - and maybe more appropriate for your case:
In the Google Drive webinterface, you navigate to your folder where your file is located - in your case within the cloned github repository.
Then (see screenshot):
right-click on the file | Open with | Colaboratory
Your file is then converted into a colabo notebook automatically (it takes at least half a minute for that). The advantage with this method is that you can create the colabo file directly in the folder. My tip is to create a copy of the original jupyter file (I added "COLABO" in the file name) as you will have different code to sync your google drive and save files than in a local jupyter notebook.
Upvotes: 3
Reputation: 341
There is not a real need of downloading the notebook. If you already have your Notebook in a GitHub repo, the only thing you need to do is:
And that should work.
Upvotes: 20
Reputation: 40828
You can upload the notebook to google drive first, then open it from there.
Upvotes: 4
Reputation: 511
One of the way could be that you can connect your google drive with the Colaboraty notebook using the following link:
Link to images within google drive from a colab notebook
Post which you can download your github repo in your google drive location. Then browse through your google drive and open the notebook using Colaboratory itself.
Upvotes: 0