|
1 | 1 | # tiktorch
|
2 |
| -[](https://circleci.com/gh/ilastik/tiktorch) |
| 2 | +[](https://circleci.com/gh/ilastik/tiktorch) |
| 3 | +[](https://github.com/psf/black) |
3 | 4 |
|
4 |
| -Wrappers for Pytorch |
| 5 | +## Installation |
| 6 | +To install tiktorch and start server run: |
| 7 | +``` |
| 8 | +conda create -n tiktorch-server-env -c ilastik-forge -c conda-forge -c pytorch tiktorch |
5 | 9 |
|
6 |
| -## tiktorch specification |
| 10 | +conda activate tiktorch-server-env |
7 | 11 |
|
8 |
| -Models saved for tiktorch must follow this specification: |
| 12 | +tiktorch-server |
| 13 | +``` |
9 | 14 |
|
10 |
| -A folder containing the files |
| 15 | +## Development environment |
11 | 16 |
|
12 |
| -- `model.py`: python file that defines the model. |
13 |
| -- `state.nn`: state dict of the model, as obtained by `torch.save(model.state_dict(), 'state.nn')` |
14 |
| -- `tiktorch_config.yml`: yaml file with metadata |
| 17 | +To create development environment run: |
15 | 18 |
|
16 |
| -The config must contain the following keys: |
| 19 | +``` |
| 20 | +conda env create --name tiktorch-env --file ./environment.yml |
| 21 | +``` |
17 | 22 |
|
18 |
| -- `input_shape`: shape of valid network input, must be either CHW (2D) or CDHW (3D) |
19 |
| -- `output_shape`: shape of network output given input with `input_shape`; same format |
20 |
| -- `dynamic_input_shape`: TODO explain |
21 |
| -- `model_class_name`: name of the model class in `model.py` |
22 |
| -- `model_init_kwargs`: keyword arguments to build model |
23 |
| -- `torch_version`: torch version used to train this model |
24 |
| - |
25 |
| -In addition, the config may contain the following keys: |
26 |
| - |
27 |
| -- `description`: Description of the pre-trained model |
28 |
| -- `data_source`: URL of the data used for pre-training |
29 |
| - |
30 |
| -TODO explain how to generate with tiktorch. |
31 |
| - |
32 |
| -Possible extensions: |
33 |
| - |
34 |
| -- specification for training set-up |
35 |
| -- specifiying additional python modules necessary to run the model |
36 |
| -- load model saved via `torch.save(model, path)` instead of state dict |
| 23 | +Run tests: |
| 24 | +``` |
| 25 | +pytest |
| 26 | +``` |
0 commit comments