diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 58137a08..ffc6bd48 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 20.2.0-alpha.5 +current_version = 20.2.0-alpha.6 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(\.(?P\d+))?)? serialize = {year}.{month}.{number}-{release}.{build} diff --git a/README.md b/README.md index a63a8358..8e150beb 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,26 @@ # tiktorch -[![CircleCI](https://circleci.com/gh/ilastik/tiktorch.svg?style=svg)](https://circleci.com/gh/ilastik/tiktorch) +[![CircleCI](https://circleci.com/gh/ilastik/tiktorch.svg?style=shield)](https://circleci.com/gh/ilastik/tiktorch) +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) -Wrappers for Pytorch +## Installation +To install tiktorch and start server run: +``` +conda create -n tiktorch-server-env -c ilastik-forge -c conda-forge -c pytorch tiktorch -## tiktorch specification +conda activate tiktorch-server-env -Models saved for tiktorch must follow this specification: +tiktorch-server +``` -A folder containing the files +## Development environment -- `model.py`: python file that defines the model. -- `state.nn`: state dict of the model, as obtained by `torch.save(model.state_dict(), 'state.nn')` -- `tiktorch_config.yml`: yaml file with metadata +To create development environment run: -The config must contain the following keys: +``` +conda env create --name tiktorch-env --file ./environment.yml +``` -- `input_shape`: shape of valid network input, must be either CHW (2D) or CDHW (3D) -- `output_shape`: shape of network output given input with `input_shape`; same format -- `dynamic_input_shape`: TODO explain -- `model_class_name`: name of the model class in `model.py` -- `model_init_kwargs`: keyword arguments to build model -- `torch_version`: torch version used to train this model - -In addition, the config may contain the following keys: - -- `description`: Description of the pre-trained model -- `data_source`: URL of the data used for pre-training - -TODO explain how to generate with tiktorch. - -Possible extensions: - -- specification for training set-up -- specifiying additional python modules necessary to run the model -- load model saved via `torch.save(model, path)` instead of state dict +Run tests: +``` +pytest +``` diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 971f7f6c..93fc9676 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -16,7 +16,7 @@ build: number: {{ GIT_DESCRIBE_NUMBER }} script: python -m pip install --no-deps --ignore-installed . string: np{{CONDA_NPY}}py{{CONDA_PY}}_{{PKG_BUILDNUM}}_h{{PKG_HASH}}_g{{GIT_FULL_HASH[:7]}} - entrypoints: + entry_points: - tiktorch-server = tiktorch.server.base:main requirements: @@ -29,6 +29,8 @@ requirements: - numpy >=1.14 - python-bioimage-io - pytorch-bioimage-io + - grpcio=1.16.0 + - protobuf=3.11.4 - pyyaml - paramiko - inferno diff --git a/environment.yml b/environment.yml index 0c20c614..ac21dc3b 100644 --- a/environment.yml +++ b/environment.yml @@ -23,6 +23,7 @@ dependencies: - conda-build - anaconda-client - bump2version + - pre_commit - pip: - pytest-grpc==0.7.0 - git+https://github.com/bioimage-io/python-bioimage-io#egg=pybio # bump diff --git a/setup.py b/setup.py index ef25a59a..98fb5cc3 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name="tiktorch", - version="20.2.0-alpha.5", + version="20.2.0-alpha.6", description="Tiktorch client/server", long_description=long_description, long_description_content_type="text/markdown",