Attaching Datastores

Attach to a RUN

When attaching datastores to a run, take note of the path your script uses. For example if your script takes an argument my_data_path and you want to mount the cats datastore:
1
grid run main.py --my_data_path grid:cats:1
Copied!

Datastore paths

Say you have a dataset with this structure:
1
my_dataset /
2
train/
3
...
4
val/
5
...
Copied!
on your local machine, you call the script like so,
1
python main.py --root my_dataset/
Copied!
your script uses the dataset like this,
1
args.add_argument('-root')
2
root = args.parse_args()
3
4
train = load(root + 'train')
5
val = load(root + 'val')
Copied!
When you upload a datastore to Grid:
1
grid datastore create --source my_dataset --name apples
Copied!
it is available under this structure:
1
train/
2
...
3
val/
4
...
Copied!
To run on this datastore, select the datastore from the dropdown
Now pass the name of the datastore to your command
which is equivalent to calling your script like so:
1
# python
2
python pl_mnist.py --root /opt/datastore
3
4
# with grid
5
python pl_mnist.py --root grid:my-dataset:1
Copied!
The datastore path has 3 parts:
1
grid:[name]:[version]
Copied!
Example, datastore named elephant (version 3)
1
grid:elephant:3
Copied!
Last modified 1mo ago