mirror of
https://github.com/Azure/MachineLearningNotebooks.git
synced 2025-12-25 01:00:11 -05:00
update samples from Release-25 as a part of 1.1.2rc0 SDK experimental release (#829)
Co-authored-by: vizhur <vizhur@live.com>
This commit is contained in:
@@ -145,9 +145,12 @@
|
||||
"import requests\n",
|
||||
"import os\n",
|
||||
"\n",
|
||||
"tf_code = requests.get(\"https://raw.githubusercontent.com/tensorflow/tensorflow/r1.8/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py\")\n",
|
||||
"tf_code = requests.get(\"https://raw.githubusercontent.com/tensorflow/tensorflow/r2.1/tensorflow/examples/tutorials/mnist/mnist_with_summaries.py\")\n",
|
||||
"input_code = requests.get(\"https://raw.githubusercontent.com/tensorflow/tensorflow/r2.1/tensorflow/examples/tutorials/mnist/input_data.py\")\n",
|
||||
"with open(os.path.join(exp_dir, \"mnist_with_summaries.py\"), \"w\") as file:\n",
|
||||
" file.write(tf_code.text)"
|
||||
" file.write(tf_code.text.replace(\"from tensorflow.examples.tutorials.mnist import input_data\", \"import input_data\"))\n",
|
||||
"with open(os.path.join(exp_dir, \"input_data.py\"), \"w\") as file:\n",
|
||||
" file.write(input_code.text)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -186,7 +189,7 @@
|
||||
"from azureml.core import Experiment\n",
|
||||
"from azureml.core.script_run_config import ScriptRunConfig\n",
|
||||
"\n",
|
||||
"logs_dir = os.path.join(os.curdir, \"logs\")\n",
|
||||
"logs_dir = os.path.join(os.curdir, os.path.join(\"logs\", \"tb-logs\"))\n",
|
||||
"data_dir = os.path.abspath(os.path.join(os.curdir, \"mnist_data\"))\n",
|
||||
"\n",
|
||||
"if not path.exists(data_dir):\n",
|
||||
@@ -334,7 +337,8 @@
|
||||
"tf_estimator = TensorFlow(source_directory=exp_dir,\n",
|
||||
" compute_target=attached_dsvm_compute,\n",
|
||||
" entry_script='mnist_with_summaries.py',\n",
|
||||
" script_params=script_params)\n",
|
||||
" script_params=script_params,\n",
|
||||
" framework_version=\"2.0\")\n",
|
||||
"\n",
|
||||
"run = exp.submit(tf_estimator)\n",
|
||||
"\n",
|
||||
@@ -396,17 +400,16 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from azureml.core.compute import ComputeTarget, AmlCompute\n",
|
||||
"\n",
|
||||
"from azureml.core.compute import AmlCompute\n",
|
||||
"# choose a name for your cluster\n",
|
||||
"cluster_name = \"cpucluster\"\n",
|
||||
"cluster_name = \"cpu-cluster\"\n",
|
||||
"\n",
|
||||
"cts = ws.compute_targets\n",
|
||||
"found = False\n",
|
||||
"if cluster_name in cts and cts[cluster_name].type == 'AmlCompute':\n",
|
||||
" found = True\n",
|
||||
" print('Found existing compute target.')\n",
|
||||
" compute_target = cts[cluster_name]\n",
|
||||
" found = True\n",
|
||||
" print('Found existing compute target.')\n",
|
||||
" compute_target = cts[cluster_name]\n",
|
||||
"if not found:\n",
|
||||
" print('Creating a new compute target...')\n",
|
||||
" compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2', \n",
|
||||
@@ -444,7 +447,8 @@
|
||||
"tf_estimator = TensorFlow(source_directory=exp_dir,\n",
|
||||
" compute_target=compute_target,\n",
|
||||
" entry_script='mnist_with_summaries.py',\n",
|
||||
" script_params=script_params)\n",
|
||||
" script_params=script_params,\n",
|
||||
" framework_version=\"2.0\")\n",
|
||||
"\n",
|
||||
"run = exp.submit(tf_estimator)\n",
|
||||
"\n",
|
||||
@@ -539,6 +543,24 @@
|
||||
"name": "roastala"
|
||||
}
|
||||
],
|
||||
"category": "training",
|
||||
"compute": [
|
||||
"Local",
|
||||
"DSVM",
|
||||
"AML Compute"
|
||||
],
|
||||
"datasets": [
|
||||
"None"
|
||||
],
|
||||
"deployment": [
|
||||
"None"
|
||||
],
|
||||
"exclude_from_index": false,
|
||||
"framework": [
|
||||
"TensorFlow"
|
||||
],
|
||||
"friendly_name": "Tensorboard integration with run history",
|
||||
"index_order": 3,
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.6",
|
||||
"language": "python",
|
||||
@@ -556,28 +578,10 @@
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.6"
|
||||
},
|
||||
"friendly_name": "Tensorboard integration with run history",
|
||||
"exclude_from_index": false,
|
||||
"index_order": 3,
|
||||
"category": "training",
|
||||
"task": "Run a TensorFlow job and view its Tensorboard output live",
|
||||
"datasets": [
|
||||
"None"
|
||||
],
|
||||
"compute": [
|
||||
"Local",
|
||||
"DSVM",
|
||||
"AML Compute"
|
||||
],
|
||||
"deployment": [
|
||||
"None"
|
||||
],
|
||||
"framework": [
|
||||
"TensorFlow"
|
||||
],
|
||||
"tags": [
|
||||
"None"
|
||||
]
|
||||
],
|
||||
"task": "Run a TensorFlow job and view its Tensorboard output live"
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
|
||||
@@ -3,4 +3,5 @@ dependencies:
|
||||
- pip:
|
||||
- azureml-sdk
|
||||
- azureml-tensorboard
|
||||
- tensorflow<1.15
|
||||
- tensorflow
|
||||
- setuptools>=41.0.0
|
||||
|
||||
Reference in New Issue
Block a user