Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Hi Everyone! Before I Ask A Question - You Develop A Very Cool Tool. Thanks! I Tried To Write Simple Pipeline Using The Pipelinedecorator. But Found That The Clearml Modifies The Code, For Example It Replaces

👋 Hi everyone!

Before I ask a question - you develop a very cool tool. Thanks!

I tried to write simple pipeline using the PipelineDecorator.
But found that the ClearML modifies the code, for example it replaces img = img[..., ::-1] with img = img[(..., ::(- 1))] , which results in error: SyntaxError: invalid syntax .
Also ClearML removes print functions.

How can I disable this behavior and what does it have to do with it?

Thanks.

  
  
Posted 2 years ago
Votes Newest

Answers 6


Thank you!

  
  
Posted 2 years ago

hi, @<1523701070390366208:profile|CostlyOstrich36>

sure:

from clearml.automation.controller import PipelineDecorator


@PipelineDecorator.component(return_values=['img'])
def get_image(image_path):
    import cv2
    img = cv2.imread(image_path)
    img = img[..., ::-1]
    return img


@PipelineDecorator.pipeline(
    project='test',
    name='test pipeline',
    version='0.0.1',
    return_value='result',
)
def executing_pipeline(params):
    print(params)
    result = get_image(params['image_path'])
    return result


if __name__ == '__main__':
    params = {'image_path': ''}
    PipelineDecorator.run_locally()
    executing_pipeline(params)
  
  
Posted 2 years ago

python test.py will results in:

Launching step [get_image]
  File "/tmp/tmp7drwjuy0.py", line 8
    img = img[(..., ::(- 1))]
                    ^
SyntaxError: invalid syntax
  
  
Posted 2 years ago

Hi @<1523703107031142400:profile|FlatOctopus65> , can you please elaborate on what exactly happens and when? Do you have a snippet to play with ?

  
  
Posted 2 years ago

@<1523701070390366208:profile|CostlyOstrich36> sorry for the typo

  
  
Posted 2 years ago

Hi @<1523703107031142400:profile|FlatOctopus65> ! python3.9 introduced a breaking change for codebases that parse code containing slices. You can read more about it here: None . Notable:

* The code that produces a Python code from AST will need to handle indexing with tuples specially (see Tools/parser/unparse.py) because d[(a, b)] is valid syntax (although parenthesis are redundant), but d[(a, b:c)] is not.

What you could do is downgrade to Python 3.8 or use the slice function:
img = img[..., slice(None, None, -1)]
Hope this workaround works for you until we fix this

  
  
Posted 2 years ago
530 Views
6 Answers
2 years ago
8 months ago
Tags