Capitalized examples task name, updated example requirements (#573)

This commit is contained in:
Rizwan Hasan 2022-02-14 14:18:41 +06:00 committed by GitHub
parent ba2e349d0c
commit b494232134
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 59 additions and 57 deletions

View File

@ -78,7 +78,7 @@ def test(args, model, device, test_loader, epoch):
def main():
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='remote_execution pytorch mnist train')
task = Task.init(project_name='examples', task_name='Remote_execution PyTorch MNIST train')
# Training settings
parser = argparse.ArgumentParser(description='PyTorch MNIST Example')
parser.add_argument('--batch-size', type=int, default=64, metavar='N',

View File

@ -2,7 +2,7 @@ from clearml import Task
for i in range(3):
task = Task.init(project_name="examples", task_name="same process, multiple tasks, Task #{}".format(i))
task = Task.init(project_name="examples", task_name="Same process, Multiple tasks, Task #{}".format(i))
# Doing Task processing here
print("Task #{} running".format(i))
#

View File

@ -20,7 +20,7 @@ from clearml import Dataset, Task
dataset_name = "cifar_dataset"
dataset_project = "dataset_examples"
task = Task.init(project_name="Image Example", task_name="image classification CIFAR10")
task = Task.init(project_name="Image Example", task_name="Image classification CIFAR10")
params = {
"number_of_epochs": 20,
"batch_size": 64,

View File

@ -7,7 +7,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="autokeras", task_name="autokeras imdb example with scalars")
task = Task.init(project_name="autokeras", task_name="AutoKeras IMDB example with scalars")
def imdb_raw():

View File

@ -6,7 +6,7 @@ from clearml import Task
@click.option('--print-something/--dont-print-something', default=True)
@click.option('--what-to-print', default='something')
def cli(print_something, what_to_print):
Task.init(project_name='examples', task_name='click multi command')
Task.init(project_name='examples', task_name='Click multi command')
if print_something:
print(what_to_print)

View File

@ -7,7 +7,7 @@ from clearml import Task
@click.option('--name', prompt='Your name',
help='The person to greet.')
def hello(count, name):
task = Task.init(project_name='examples', task_name='click single command')
task = Task.init(project_name='examples', task_name='Click single command')
"""Simple program that greets NAME for a total of COUNT times."""
for x in range(count):

View File

@ -8,7 +8,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="fastai with tensorboard callback")
task = Task.init(project_name="examples", task_name="Fastai with TensorBoard callback")
path = untar_data(URLs.MNIST_SAMPLE)

View File

@ -17,5 +17,5 @@ class BrokenCalculator(object):
if __name__ == "__main__":
Task.init(project_name="examples", task_name="fire class command")
Task.init(project_name="examples", task_name="Fire class command")
fire.Fire(BrokenCalculator)

View File

@ -14,7 +14,7 @@ def multiply(x, y):
if __name__ == "__main__":
Task.init(project_name="examples", task_name="fire dict command")
Task.init(project_name="examples", task_name="Fire dict command")
fire.Fire(
{
"add": add,

View File

@ -40,5 +40,5 @@ class Pipeline(object):
if __name__ == "__main__":
Task.init(project_name="examples", task_name="fire grouping command")
Task.init(project_name="examples", task_name="Fire grouping command")
fire.Fire(Pipeline)

View File

@ -18,5 +18,5 @@ def serve(addr, port, should_serve=False):
if __name__ == "__main__":
Task.init(project_name="examples", task_name="fire multi command")
Task.init(project_name="examples", task_name="Fire multi command")
fire.Fire()

View File

@ -14,6 +14,6 @@ class Calculator(object):
if __name__ == "__main__":
Task.init(project_name="examples", task_name="fire object command")
Task.init(project_name="examples", task_name="Fire object command")
calculator = Calculator()
fire.Fire(calculator)

View File

@ -11,5 +11,5 @@ def hello(count, name="clearml", prefix="prefix_", suffix="_suffix", **kwargs):
if __name__ == "__main__":
Task.init(project_name="examples", task_name="fire single command")
Task.init(project_name="examples", task_name="Fire single command")
fire.Fire(hello)

View File

@ -10,7 +10,7 @@ from clearml import Task
@hydra.main(config_path="config_files", config_name="config")
def my_app(cfg):
# type (DictConfig) -> None
task = Task.init(project_name="examples", task_name="hydra configuration")
task = Task.init(project_name="examples", task_name="Hydra configuration")
logger = task.get_logger()
logger.report_text("You can view your full hydra configuration under Configuration tab in the UI")
print(OmegaConf.to_yaml(cfg))

View File

@ -19,7 +19,7 @@ from clearml import Task, StorageManager
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='image classification CIFAR10')
task = Task.init(project_name='examples', task_name='Image classification CIFAR10')
params = {'number_of_epochs': 20, 'batch_size': 64, 'dropout': 0.25, 'base_lr': 0.001, 'momentum': 0.9, 'loss_report': 100}
params = task.connect(params) # enabling configuration override by clearml
print(params) # printing actual configuration (after override in remote mode)

View File

@ -94,7 +94,7 @@ def train(dataloader, args):
def main():
task = Task.init(project_name="examples", task_name="megengine mnist train") # noqa
task = Task.init(project_name="examples", task_name="MegEngine MNIST train") # noqa
parser = argparse.ArgumentParser(description="MegEngine MNIST Example")
parser.add_argument(

View File

@ -55,7 +55,7 @@ class LitClassifier(pl.LightningModule):
if __name__ == '__main__':
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="pytorch lightning mnist example")
task = Task.init(project_name="examples", task_name="PyTorch lightning MNIST example")
pl.seed_everything(0)

View File

@ -113,7 +113,7 @@ def test(args, model, device, test_loader, epoch):
def main(_):
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="pytorch mnist train with abseil")
task = Task.init(project_name="examples", task_name="PyTorch MNIST train with abseil")
use_cuda = FLAGS.cuda and torch.cuda.is_available()

View File

@ -64,7 +64,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='pytorch with matplotlib example', task_type=Task.TaskTypes.testing)
task = Task.init(project_name='examples', task_name='PyTorch with Matplotlib example', task_type=Task.TaskTypes.testing)
######################################################################

View File

@ -76,7 +76,7 @@ def test(args, model, device, test_loader, epoch):
def main():
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='pytorch mnist train')
task = Task.init(project_name='examples', task_name='PyTorch MNIST train')
# Training settings
parser = argparse.ArgumentParser(description='PyTorch MNIST Example')

View File

@ -23,7 +23,7 @@ def main():
# from here on everything is logged automatically
task = Task.init(
project_name="examples",
task_name="Model update pytorch",
task_name="Model update PyTorch",
auto_connect_frameworks={"pytorch": False},
)
params = {

View File

@ -102,7 +102,7 @@ def main():
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='pytorch with tensorboard') # noqa: F841
task = Task.init(project_name='examples', task_name='PyTorch with TensorBoard') # noqa: F841
writer = SummaryWriter('runs')
writer.add_text('TEXT', 'This is some text', 0)

View File

@ -1,7 +1,9 @@
matplotlib
tensorboardX
tensorboard>=1.14.0
torch>=1.1.0
torchvision>=0.3.0
torch >= 1.1.0 ; python_version >= '3.8'
torch <= 1.5.1 ; python_version < '3.8'
torchvision
tqdm
clearml
jsonschema==3.2.0 ; python_version <= '3.5'
clearml

View File

@ -10,7 +10,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='pytorch tensorboard toy example')
task = Task.init(project_name='examples', task_name='PyTorch TensorBoard toy example')
writer = SummaryWriter(log_dir=os.path.join(gettempdir(), 'tensorboard_logs'))

View File

@ -14,7 +14,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="scikit-learn joblib example")
task = Task.init(project_name="examples", task_name="Scikit-learn joblib example")
iris = datasets.load_iris()
X = iris.data

View File

@ -102,7 +102,7 @@ def main():
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='pytorch with tensorboardX')
task = Task.init(project_name='examples', task_name='PyTorch with tensorboardX')
writer = SummaryWriter('runs')
writer.add_text('TEXT', 'This is some text', 0)

View File

@ -42,7 +42,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='tensorboard pr_curve')
task = Task.init(project_name='examples', task_name='TensorBoard pr_curve')
tf.compat.v1.disable_v2_behavior()
FLAGS = flags.FLAGS

View File

@ -12,7 +12,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='tensorboard toy example')
task = Task.init(project_name='examples', task_name='TensorBoard toy example')
k = tf.placeholder(tf.float32)

View File

@ -37,7 +37,7 @@ tf.compat.v1.enable_eager_execution()
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='Tensorflow eager mode')
task = Task.init(project_name='examples', task_name='TensorFlow eager mode')
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_integer('data_num', 100, """Flag of type integer""")

View File

@ -37,7 +37,7 @@ FLAGS = None
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='Tensorflow mnist with summaries example')
task = Task.init(project_name='examples', task_name='TensorFlow MNIST with summaries example')
def train():

View File

@ -41,7 +41,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='tensorboard pr_curve')
task = Task.init(project_name='examples', task_name='TensorBoard pr_curve')
tf.compat.v1.disable_v2_behavior()
FLAGS = flags.FLAGS

View File

@ -61,7 +61,7 @@ def generate_summary(k, step):
tf.summary.image("test_rgba", image_rgba, max_outputs=10, step=step)
task = Task.init(project_name='examples', task_name='tensorboard toy example')
task = Task.init(project_name='examples', task_name='TensorbBoard toy example')
# create the tensorboard file writer in a temp folder
writer = tf.summary.create_file_writer(os.path.join(gettempdir(), "toy_tb_example"))

View File

@ -13,7 +13,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='Tensorflow v2 mnist with summaries')
task = Task.init(project_name='examples', task_name='TensorFlow v2 MNIST with summaries')
# Load and prepare the MNIST dataset.

View File

@ -4,7 +4,7 @@ from sklearn.model_selection import train_test_split
from clearml import Task
task = Task.init(project_name="examples", task_name="xgboost metric auto reporting")
task = Task.init(project_name="examples", task_name="XGBoost metric auto reporting")
X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(

View File

@ -55,7 +55,7 @@ if __name__ == '__main__':
# create the pipeline controller
pipe = PipelineController(
project='examples',
name='pipeline demo',
name='Pipeline demo',
version='1.1',
add_pipeline_tags=False,
)

View File

@ -20,7 +20,7 @@ def post_execute_callback_example(a_pipeline, a_node):
# Connecting ClearML with the current pipeline,
# from here on everything is logged automatically
pipe = PipelineController(
name='pipeline demo',
name='Pipeline demo',
project='examples',
version='0.0.1',
add_pipeline_tags=False,
@ -28,16 +28,16 @@ pipe = PipelineController(
pipe.set_default_execution_queue('default')
pipe.add_step(name='stage_data', base_task_project='examples', base_task_name='pipeline step 1 dataset artifact')
pipe.add_step(name='stage_data', base_task_project='examples', base_task_name='Pipeline step 1 dataset artifact')
pipe.add_step(name='stage_process', parents=['stage_data', ],
base_task_project='examples', base_task_name='pipeline step 2 process dataset',
base_task_project='examples', base_task_name='Pipeline step 2 process dataset',
parameter_override={'General/dataset_url': '${stage_data.artifacts.dataset.url}',
'General/test_size': 0.25},
pre_execute_callback=pre_execute_callback_example,
post_execute_callback=post_execute_callback_example
)
pipe.add_step(name='stage_train', parents=['stage_process', ],
base_task_project='examples', base_task_name='pipeline step 3 train model',
base_task_project='examples', base_task_name='Pipeline step 3 train model',
parameter_override={'General/dataset_task_id': '${stage_process.id}'})
# for debugging purposes use local jobs

View File

@ -1,7 +1,7 @@
from clearml import Task, StorageManager
# create an dataset experiment
task = Task.init(project_name="examples", task_name="pipeline step 1 dataset artifact")
task = Task.init(project_name="examples", task_name="Pipeline step 1 dataset artifact")
# only create the task, we will actually execute it later
task.execute_remotely()

View File

@ -5,7 +5,7 @@ from sklearn.model_selection import train_test_split
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="pipeline step 2 process dataset")
task = Task.init(project_name="examples", task_name="Pipeline step 2 process dataset")
# program arguments
# Use either dataset_task_id to point to a tasks artifact or

View File

@ -8,7 +8,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="pipeline step 3 train model")
task = Task.init(project_name="examples", task_name="Pipeline step 3 train model")
# Arguments
args = {

View File

@ -9,7 +9,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='artifacts example')
task = Task.init(project_name='examples', task_name='Artifacts example')
df = pd.DataFrame(
{

View File

@ -8,7 +8,7 @@ from clearml import Task
def main():
# Getting the task we want to get the artifacts from
artifacts_task = Task.get_task(project_name='examples', task_name='artifacts example')
artifacts_task = Task.get_task(project_name='examples', task_name='Artifacts example')
# getting the numpy object back
numpy_artifact = artifacts_task.artifacts['Numpy Eye'].get()

View File

@ -219,7 +219,7 @@ def report_html_image(logger, iteration=0):
def main():
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="html samples reporting")
task = Task.init(project_name="examples", task_name="HTML samples reporting")
print('reporting html files into debug samples section')

View File

@ -12,7 +12,7 @@ from clearml import Task
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name='examples', task_name='hyper-parameters example')
task = Task.init(project_name='examples', task_name='Hyper-parameters example')
parameters = {
'list': [1, 2, 3],

View File

@ -45,7 +45,7 @@ def report_debug_images(logger, iteration=0):
def main():
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="image reporting")
task = Task.init(project_name="examples", task_name="Image reporting")
print('reporting a few debug images')

View File

@ -6,7 +6,7 @@ from clearml import Task, Logger
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="audio and video reporting")
task = Task.init(project_name="examples", task_name="Audio and video reporting")
print('reporting audio and video samples to the debug samples section')

View File

@ -45,7 +45,7 @@ def report_table(logger, iteration=0):
def main():
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="table reporting")
task = Task.init(project_name="examples", task_name="Table reporting")
print('reporting pandas tables and python lists as tables into the plots section')

View File

@ -23,7 +23,7 @@ def report_scalars(logger):
def main():
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="scalar reporting")
task = Task.init(project_name="examples", task_name="Scalar reporting")
print('reporting scalar graphs')

View File

@ -60,7 +60,7 @@ Vestibulum dictum ipsum at viverra ultrices. Aliquam sed ante massa. Quisque con
def main():
# Connecting ClearML with the current process,
# from here on everything is logged automatically
task = Task.init(project_name="examples", task_name="text reporting")
task = Task.init(project_name="examples", task_name="Text reporting")
print("reporting text logs")

View File

@ -6,16 +6,16 @@ from clearml import Task
from time import sleep
task1 = Task.init(project_name='examples', task_name='create artifact')
task1 = Task.init(project_name='examples', task_name='Create artifact')
# upload data file to the initialized task, inputting a name and file location
task1.upload_artifact(name='data file', artifact_object='data_samples/sample.json')
# close the task, to be able to initialize a new task
task1.close()
# initialize another task to use some other task's artifacts
task2 = Task.init(project_name='examples', task_name='use artifact from other task')
task2 = Task.init(project_name='examples', task_name='Use artifact from other task')
# get instance of Task that created artifact (task1), using Task's project and name. You could also use its ID number.
preprocess_task = Task.get_task(project_name='examples', task_name='create artifact')
preprocess_task = Task.get_task(project_name='examples', task_name='Create artifact')
# access artifact from task1, using the artifact's name
# get_local_copy() caches the files for later use and returns a path to the cached file
local_json = preprocess_task.artifacts['data file'].get_local_copy()

View File

@ -15,7 +15,7 @@ scheduler = TaskScheduler()
# Run the pipeline Task 'pipeline demo, every day at 10:30am
scheduler.add_task(
name='recurring pipeline job',
schedule_task_id=Task.get_task(project_name='examples', task_name='pipeline demo'),
schedule_task_id=Task.get_task(project_name='examples', task_name='Pipeline demo'),
queue='default',
minute=30,
hour=10,