Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I access the Workspace object from a training script in AzureML?

I want to access the Workspace object in my train.py script, when running in an Estimator.

I currently can access the Run object, using the following code:

run = Run.get_context()

But I cannot seem to get my hands on the Workspace object in my training script. I would use this mostly to get access to the Datastores and Datasets (as I would hope to keep all data set references inside the training script, instead of passing them as input datasets)

Any idea if/how this is possible ?

like image 690
Sam Vanhoutte Avatar asked Oct 19 '25 02:10

Sam Vanhoutte


1 Answers

Sure, try this:

from azureml.core.run import Run
run = Run.get_context()
ws = run.experiment.workspace
like image 105
Román Aguilar Avatar answered Oct 21 '25 16:10

Román Aguilar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!