Hello,
i have a problem with preparing the compressed tarball (*.tar.gz) of my MLCube config files.
My folder structure looks like this:
```
medperf
??? cwdm
??? mlcube
? ??? mlcube.yaml
? ??? workspace
? ??? additional_files
? ? ??? flair_gen.pt
? ? ??? t1ce_gen.pt
? ? ??? t1_gen.pt
? ? ??? t2_gen.pt
? ??? parameters.yaml
??? project
??? ...
??? ...
```
My `mlcube.yaml` looks like this:
```
name: melide_GlobalSynthesis_BraTS2024
description: Submission to the BraTS 2024 Global Synthesis Challenge. Team 'melide'. Model generates missing modality MR images.
authors:
- {name: Team melide}
platform:
accelerator_count: 0
docker:
# Image name
image: docker.synapse.org/syn60334949/cwdm:v1.0
# Docker build context relative to $MLCUBE_ROOT. Default is `build`.
build_context: "../project"
# Docker file name within docker build context, default is `Dockerfile`.
build_file: "Dockerfile"
tasks:
infer:
# Computes predictions on input data
parameters:
inputs: {
data_path: data/,
parameters: parameters.yaml,
parameters_t1gen: additional_files/t1_gen.pt,
parameters_t1cegen: additional_files/t1ce_gen.pt,
parameters_t2gen: additional_files/t2_gen.pt,
parameters_flairgen: additional_files/flair_gen.pt,
}
outputs: {output_path: {type: directory, default: predictions}}
```
Following the instructions I first run:
```
~/medperf/cwdm/mlcube/workspace$ tar -czf additional_files.tar.gz -C ~/medperf/cwdm/mlcube/workspace/additional_files .
```
When I then run:
```
~/medperf$ python scripts/package-mlcube.py --mlcube cwdm/mlcube/ --mlcube-types 'model' --output melide.tar.gz
```
I get the following output:
```
Docker runner configuration identified
Remember to push your image to a registry with:
docker push docker.synapse.org/syn60334949/cwdm:v1.0
ERROR: Additional inputs must point to files in "additional_files"
```
Do you know how to solve this problem?
Created by irdeirfp @irdeirfp ,
Yes, that looks correct to me. @vchung Thanks, then I'll manually create the config tarball.
Is this structure correct?
```
model.tar.gz
??? parameters.yaml
??? mlcube.yaml
??? additional_files.tar.gz
??? t1_gen.pt
??? t1ce_gen.pt
??? t2_gen.pt
??? flair_gen.pt
```
Thanks for your help.
@irdeirfp ,
Yes, I was going to suggest that it may be more convenient at this point to manually create the config tarball instead of trying to debug. Apologies for the inconvenience. @vchung Would it also be possible to manually create a `*tar.gz` file similar to the on in your dummy model? @vchung Thanks. This is what I actually tried in the first place, but I always get this `ERROR: Additional inputs must point to files in "additional_files"` error and don't really understand what the problem is, as my additional inputs actually do point to files in the `mlcube/workspace/additional_files` folder. @irdeirfp ,
Great question. When using the convenience script provided by medperf (`scripts/package-mlcube.py`), you will not need to follow the instructions from the previous section, that is: the step where you had manually created the additional_files tarball. Instead, the script will recognize that the `addtional_files.tar.gz` will need to be created on your behalf based on your mlcube.yaml file.
So for example, given this dummy model MLCube:
```text
dummy_model
??? mlcube.yaml
??? workspace
??? additional_files
? ??? foo.txt
??? parameters.yaml
```
After running the script, the resulting tarball will look like this:
```sh
$ python scripts/package-mlcube.py --mlcube ~/Desktop/dummy_model --mlcube-types model --output ~/Desktop/model.tar.gz
...[truncated]
? Done!
$ tar -tf ~/Desktop/model.tar.gz
parameters.yaml
mlcube.yaml
additional_files.tar.gz
```
Hope this helps!
Drop files to upload
Error when preparing the compressed tarball (*.tar.gz) of MLCubes configs page is loading…