|
8 | 8 | skip it if you run the tutorials on your machine. |
9 | 9 | """ |
10 | 10 | # sphinx_gallery_thumbnail_path = "static/colab.png" |
11 | | - |
| 11 | +# |
12 | 12 | ############################################################################### |
13 | 13 | # Change runtime to use a GPU |
14 | 14 | # --------------------------- |
|
20 | 20 | # (Menu) "Runtime" -> "Change runtime type" -> "Hardware accelerator" -> "GPU". |
21 | 21 |
|
22 | 22 | ############################################################################### |
23 | | -# Mount data with Google Drive |
24 | | -# ---------------------------- |
25 | | -# |
26 | | -# First, open the following Google Drive link: |
27 | | -# https://drive.google.com/drive/folders/1NuxO5_GHgDvjrL2FX5ohzAsvWpZuepIA |
| 23 | +# Download the data and install all required dependencies |
| 24 | +# ------------------------------------------------------- |
28 | 25 | # |
29 | | -# Then, click on the directory name ("vim-5"), and add a shortcut to your Drive |
30 | | -# ("Add shortcut to Drive"). Place the shortcut in the main directory of your |
31 | | -# Google Drive. Do not place it in another folder, or you will have to change |
32 | | -# the code to update the location of the dataset. |
33 | | -# |
34 | | -# Finally, mount Google Drive in Google Colab. To do so, run the following cell, |
35 | | -# and follow the instructions from Google to copy/paste the authorization code. |
| 26 | +# Uncomment and run the following cell to download the tutorial data and |
| 27 | +# install the required dependencies |
36 | 28 |
|
37 | | -from google.colab import drive |
38 | | -drive.mount("/content/drive") |
| 29 | +# !gdown --id 1b0I0Ytj06m6GCmfxfNrZuyF97fDo3NZb && \ |
| 30 | +# tar xzf vim-5-for-ccn.tar.gz && \ |
| 31 | +# pip install -q voxelwise_tutorials && \ |
| 32 | +# git clone https://github.com/gallantlab/pycortex |
39 | 33 |
|
40 | 34 | ############################################################################### |
41 | | -# Uncomment and run the following command to check that Google Drive was |
42 | | -# correctly mounted. |
43 | | - |
44 | | -# !ls drive/MyDrive/vim-5 |
45 | | - |
46 | | -############################################################################### |
47 | | -# Tell the voxelwise_tutorials package where the data is. (If you placed the |
48 | | -# shortcut in a different location than the main directory of your Google |
49 | | -# Drive, change this code to point to the correct location.) |
50 | | - |
| 35 | +# Now run the following cell to set up the environment variables for the tutorials |
| 36 | +# and pycortex. |
| 37 | + |
51 | 38 | import os |
52 | | -os.environ['VOXELWISE_TUTORIALS_DATA'] = "drive/MyDrive/" |
53 | | - |
54 | | -############################################################################### |
55 | | -# Install package helper |
56 | | -# ---------------------- |
57 | | -# |
58 | | -# Finally, install the tutorial helper package, by uncommenting and running |
59 | | -# the install command. |
60 | | - |
61 | | -# !pip install voxelwise_tutorials |
62 | | - |
63 | | -############################################################################### |
64 | | -# When using Colab, the install of pycortex might fail to locate the default |
65 | | -# pycortex filestore. Uncomment and run the following line to fix it: |
66 | | - |
67 | | -# !git clone https://github.com/gallantlab/pycortex |
68 | | - |
69 | | -############################################################################### |
70 | | -# Now change the pycortex filestore path. |
| 39 | +os.environ['VOXELWISE_TUTORIALS_DATA'] = "/content" |
71 | 40 |
|
72 | 41 | import cortex |
73 | 42 | filestore = "/content/pycortex/filestore/" |
|
0 commit comments