Skip to content

Commit

Permalink
Add more exp info (#33)
Browse files Browse the repository at this point in the history
* added info on dependencies

* added newline

* fixed flake8

* fixed typos

* printing dependencies now

* updated numpy version
  • Loading branch information
mirkobronzi authored Jul 22, 2020
1 parent 52ed67a commit 0379417
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
6 changes: 4 additions & 2 deletions tests/end2end_pytorch/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ cd ${DIR}
cookiecutter ../.. --no-input --output-dir=./
cd wonderful_project
pip install -e . --quiet
pip install flake8 pytest --quiet

# necessary cause tf dependencies are sometimes not updated
pip install -U setuptools numpy six --quiet

# print all dependencies
pip freeze

# run flake8 test first
pip install flake8 --quiet
sh config/hooks/pre-commit

# run tests
pip install pytest --quiet
pytest .

# run the example
Expand Down
6 changes: 4 additions & 2 deletions tests/end2end_tensorflow/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ cd ${DIR}
python -c "from cookiecutter.main import cookiecutter; cookiecutter('../..', no_input=True, extra_context={'dl_framework': 'tensorflow_cpu'}, output_dir='./')"
cd wonderful_project
pip install -e . --quiet
pip install flake8 pytest --quiet
# necessary cause tf dependencies are sometimes not updated
pip install -U setuptools numpy six --quiet

# print all dependencies
pip freeze

# run flake8 test first
pip install flake8 --quiet
sh config/hooks/pre-commit

# run tests
pip install pytest --quiet
pytest .

# run the examples
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ First, bring you project on the Mila cluster (assuming you didn't create your
project directly there). To do so, simply login on the Mila cluster and git
clone your project:

[email protected]:{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}.git
git clone git@github.com:{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}.git

Then activate your virtual env, and install the dependencies:

Expand Down Expand Up @@ -153,7 +153,7 @@ To do so, simply run `sh run.sh` N times.
When Orion has completed the trials, you will find the orion db file and the
mlruns folder (i.e., the folder containing the mlflow results).

You will also find the output of your experiments in `orion_workinf_dir`, which
You will also find the output of your experiments in `orion_working_dir`, which
will contain a folder for every trial.
Inside these folders, you can find the models (the best one and the last one), the config file with
the hyper-parameters for this trial, and the log file.
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'flake8-docstrings',
'gitpython',
'tqdm',
'mlflow',
'mlflow==1.10.0',
'orion>=0.1.8',
'pyyaml>=5.3',
'pytest>=4.6',
Expand All @@ -34,7 +34,7 @@
'scipy==1.4.1',
'setuptools>=41.0.0',
'six>=1.12.0',
'numpy==1.19'],
'numpy==1.19.1'],
{%- endif %}
entry_points={
'console_scripts': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import socket

from pip._internal.operations import freeze
from git import InvalidGitRepositoryError, Repo
from mlflow.utils.mlflow_tags import MLFLOW_RUN_NOTE

Expand Down Expand Up @@ -63,7 +64,10 @@ def log_exp_details(script_location, args): # pragma: no cover
"""
git_hash = get_git_hash(script_location)
hostname = socket.gethostname()
message = "\nhostname: {}\ngit code hash: {}\ndata folder: {}\ndata folder (abs): {}".format(
hostname, git_hash, args.data, os.path.abspath(args.data))
logger.info('Experiment info:' + message + '\n')
mlflow.set_tag(key=MLFLOW_RUN_NOTE, value=message)
dependencies = freeze.freeze()
details = "\nhostname: {}\ngit code hash: {}\ndata folder: {}\ndata folder (abs): {}\n\n" \
"dependencies:\n{}".format(
hostname, git_hash, args.data, os.path.abspath(args.data),
'\n'.join(dependencies))
logger.info('Experiment info:' + details + '\n')
mlflow.set_tag(key=MLFLOW_RUN_NOTE, value=details)

0 comments on commit 0379417

Please sign in to comment.