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
Hey, Is There An Easy Way To Retrieve The Code Used To Run An Experiment? Without Recreating The Whole Environment Etc. The Problem: I Have Ran A

Hey, is there an easy way to retrieve the code used to run an experiment? Without recreating the whole environment etc.

The problem:
I have ran a .py script as an experiment 1 , changed some code, ran it as experiment 2 , changed some code, ran it as experiment 3 . Running the same script file with changes basicaly, no git commit used.
But one line of code in the script caused experiment 1 and experiment 2 to crash and i fixed that line only on experiment 3 . I'd like to get the code of experiment 1 and experiment 2 , in some form (as a file or in a clipboard) where i could apply the same fix and launch it to complete correctly.
I know that experiment stores the uncommited code changes but i have no idea how to translate them into a file in a clean way.

  
  
Posted 3 years ago
Votes Newest

Answers 4


If you didn't use git, then clearML saves your .py script completely in the uncommited changes section like you say. You should be able to just copy paste it to get the code. In what format are your uncommited changes logged? Can you paste a screenshot or paste the contents of uncommitted changes ?

  
  
Posted 3 years ago

ExasperatedCrab78 the problem is it is saved, rendered and copied to clipboard via a button as a git diff stdout, not as a valid python code

  
  
Posted 3 years ago

ExasperatedCrab78 Such a git patch appeared to track a lot of unrelated unexecuted stuff. And was whimsical when being applied - it errored on all those unrelated code files as far as i could tell so i had to use --reject in git apply --reject --whitespace=fix experiment-a1fbb0ecfc4e4d698e017d8356d8be52.patch

I get that this feature is probably coming from a robust reproducibility design perspective. If only there'd be a shortcut tho. For example, official Python VSCode extension has this thing: you can execute select lines of code from a source file via Python Interactive ,and then one can export all the executed code into a standalone notebook (it will not have any other code from the source file).
Gather python VSCode extension does something similair but from notebooks: after you execute cells in the notebook it allows to export all the code that was necessary to execute that cell into a standalone notebook.
Both solutions do not stalk for changes in the whole package and personally i've found them quite enabling.

A good enough solution would be, i think, having an option of listing git diff for each file separately. So I could pick which files i wanna rollback via git apply

  
  
Posted 3 years ago

You can apply git diffs by copying the diff to a file and then running git apply <file_containing_diff>

But check this thread to make sure to dry-run first, to check what it will do, before you overwrite anything
https://stackoverflow.com/questions/2249852/how-to-apply-a-patch-generated-with-git-format-patch

  
  
Posted 3 years ago
1K Views
4 Answers
3 years ago
one year ago
Tags