Dear BraTS 2023 Participants,
We are thrilled to see the participation in the validation phase of the challenge. We have received requests to extend the submission deadline for the short summary manuscript and MLCube. Organisers have decided to extend the deadline by two weeks. Please chEck the updates schedule here: https://synapse.org/brats
This year we are expecting **MLCube** submission to evaluate your algorithm on hidden testing dataset. The detailed instruction are available here: https://www.synapse.org/#!Synapse:syn51156910/wiki/622674
Top-performing teams of all the challenges will be provided MonetaryAwards/Certificates at the conclusion of the challenge.
Ujjwal [On behalf of BraTS Organizing Team]
Created by Ujjwal Baid ujjwalbaid
medperf test run --demo_dataset_url synapse:syn52276402 --demo_dataset_hash "16526543134396b0c8fd0f0428be7c96f2142a66" -p ./prep_segmentation -m "/home/hln0895/medperf/menunet/mlcube/" -e ./eval_segmentation --offline --no-cache
ERROR: Predictions number don't match labels
**When running this commend, where is the output prediction folder?** @kbmantha ,
When you go to submit your Docker image, you should select the queue named "BraTS 2023: Docker Images". Instructions on how to submit a Docker image is available on the [MLCube Submission Tutorial here](https://www.synapse.org/#!Synapse:syn51156910/wiki/622674) (under "Submit your MLCube")! Let us know if you're having trouble navigating this.
---
@adamsyah ,
Great question. The deadline for MLCube submissions is tomorrow, Aug. 21st, at 23:59 UTC. Hi, when will the MLCube submission close today? Is it 00:00:00 UTC? Thanks @neuronflow Sure I am in favor of splitting threads anyway since this one became too long. We should however keep referring inpainting MLCube authors to also check this thread as well since until now all the questions are not task-specific at all. @huilin when modifying `mlcube.py`, the thing that you will be doing is calling your inference logic that you have written somewhere else, while passing the `data_path` and `output_path`. I don't understand what do you mean by "set the data_path and output_path" (you will not 'set' them). As you can see [here in this worked example](https://docs.medperf.org/mlcubes/mlcube_models/#modify-mlcubepy), the line `run_inference(data_path, parameters, output_path, weights)` calls your inference logic while passing to it the `data_path` and `output_path`.
@msadi002 `--mlcube types` should be set to `model`. For your other question asking about the error, it seems that you have modified the signature of `infer` command inside `mlcube.py`. Please [carefully follow the guide](https://docs.medperf.org/mlcubes/mlcube_models). The `infer` command should have certain arguments that shouldn't be changed, and adding additional arguments should be accompanied by modifying `mlcube.yaml`. Your arguments seem to be scalars not filesystem paths, so these should go in `parameters.yaml`. All of this is documented in the mentioned guide.
A small favor: when posting a question here, please enclose your errors and code inside a markdown code block (within two ` ``` `). Also click `Preview` to see if they are readable. Thanks!
@vchung , thank you for the above clarification. Our team name is UMNiverse and the project name is "BraTS 2023 \-- UMN Zooniverse Team" (syn52072898). Yes, our short paper was submitted with the "BraTS 2023 \-- UMN Zooniverse Team" as the team name. Can you please make sure that our team submission is properly received and associated?
Additionally, can you please clarify on where **BraTS 2023: Docker Image queue** is? We are unable to find additional info on this.
Thank you and sorry for the confusion on our end!
Kameswara Mantha @kbmantha ,
The validation queues are no longer open, hence the warning you received about the submission timeline. For MLCubes, you must submit:
* the **Docker image** to the BraTS 2023: Docker Image queue
* the **config tarball** to one of:
* BraTS 2023: Evaluating Augmentations for BraTS (MLCube)
* BraTS 2023: Segmentation - Adult Glioma (MLCube)
* BraTS 2023: Segmentation - BraTS-Africa (MLCube)
* BraTS 2023: Segmentation - Meningioma (MLCube)
* BraTS 2023: Segmentation - Brain Metastases (MLCube)
* BraTS 2023: Segmentation - Pediatric Tumors (MLCube)
* BraTS 2023: Synthesis (Global) - Missing MRI (MLCube)
* BraTS 2023: Synthesis (Local) - Inpainting (MLCube)
Note that only the challenges you submitted a short paper to will be displayed when making a submission.
Also, is the team name submitted with your short paper, "BraTS 2023 -- UMN Zooniverse Team"? We were having trouble finding that name on Synapse, so that could explain why you did not see the queues listed above! Hi @vchung ! A really quick question! We are trying to submit our MLCube docker image and we are suddenly not able to see any of our contributors within our team for submission! Additionally, we see a warning that the submission timeline is out of the window! Can you please help?
Thank you,
Kameswara Mantha I am facing this error:
usage: mlcube.py [-h] [--resnet_n_downsample RESNET_N_DOWNSAMPLE]
[--resnet_n_blocks RESNET_N_BLOCKS]
[--resnet_kernel_size RESNET_KERNEL_SIZE]
[--resnet_initial_kernel_size RESNET_INITIAL_KERNEL_SIZE]
[--name NAME] [--gpu_ids GPU_IDS]
[--checkpoints_dir CHECKPOINTS_DIR] [--model MODEL]
[--norm_G NORM_G] [--norm_D NORM_D] [--norm_E NORM_E]
[--phase PHASE] [--batchSize BATCHSIZE]
[--preprocess_mode {resize_and_crop,crop,scale_width,scale_width_and_crop,scale_shortside,scale_shortside_and_crop,fixed,none}]
[--load_size LOAD_SIZE] [--crop_size CROP_SIZE]
[--aspect_ratio ASPECT_RATIO] [--label_nc LABEL_NC]
[--contain_dontcare_label] [--output_nc OUTPUT_NC]
[--serial_batches] [--no_flip] [--nThreads NTHREADS]
[--max_dataset_size MAX_DATASET_SIZE] [--load_from_opt_file]
[--cache_filelist_write] [--cache_filelist_read]
[--display_winsize DISPLAY_WINSIZE] [--netG NETG] [--ngf NGF]
[--init_type INIT_TYPE] [--init_variance INIT_VARIANCE]
[--z_dim Z_DIM] [--no_instance] [--nef NEF]
[--use_vae USE_VAE] [--display_freq DISPLAY_FREQ]
[--print_freq PRINT_FREQ]
[--save_latest_freq SAVE_LATEST_FREQ]
[--save_epoch_freq SAVE_EPOCH_FREQ] [--no_html] [--debug]
[--tf_log] [--continue_train] [--which_epoch WHICH_EPOCH]
[--niter NITER] [--niter_decay NITER_DECAY]
[--optimizer OPTIMIZER] [--beta1 BETA1] [--beta2 BETA2]
[--no_TTUR] [--lr LR] [--D_steps_per_G D_STEPS_PER_G]
[--ndf NDF] [--lambda_feat LAMBDA_FEAT]
[--lambda_vgg LAMBDA_VGG] [--no_ganFeat_loss] [--no_vgg_loss]
[--gan_mode GAN_MODE] [--netD NETD] [--lambda_kld LAMBDA_KLD]
[--num_upsampling_layers {normal,more,most}]
[--netD_subarch NETD_SUBARCH] [--num_D NUM_D]
[--n_layers_D N_LAYERS_D]
mlcube.py: error: unrecognized arguments: infer --data_path=/mlcube_io0 --output_path=/mlcube_io1
2023-08-20 15:32:48 MAEUbuntuKH234 mlcube.shell[20512] ERROR Shell.run command='docker run --volume /home/msadi002/BraTS_Inpainting_input:/mlcube_io0 --volume /home/msadi002/BraTS_Inpainting_output:/mlcube_io1 docker.synapse.org/syn52069069/brats-inpainting:0.1 infer --data_path=/mlcube_io0 --output_path=/mlcube_io1' status=512 exit_status=exited exit_code=2 on_error=raise
2023-08-20 15:32:48 MAEUbuntuKH234 mlcube.__main__[20512] ERROR run failed to run MLCube with error code 2.
Traceback (most recent call last):
Thank you
@lulululu ,
Apologies, I'm not sure why it disappeared from your dashboard (maybe try doing another browser refresh?). Rest assured, I checked and your submission ID 9739694 (and Docker submission 9739693) are in the system - you're good! @hasank would it make sense to outsource the creation of the inpainting ML cubes to a different thread, as they follow a slightly different pattern? This way the likelihood, that you have to answer the same question multiple times should also decrease? Hi Moderators (@hasank @vchung @ujjwalbaid ),
Please could you assist with creating the medperf MLCube, where we only have access to a Windows System.
I have posted a separate thread [here](https://www.synapse.org/#!Synapse:syn51156910/discussion/threadId=10455), which is being followed by several teams from the BraTS-Africa challenge who are experiencing the same difficulty.
If anyone could provide assistance with a work around, we would all really appreciate it.
Thank you in advance! Hi, I don't understand this.
--mlcube-types \
Comma-separated list of mlcube types to look for. Valid ones are: 'data-preparator' for a data preparation MLCube, 'model' for a model MLCube, and 'metrics' for a metrics
MLCube.
In our case what will be mlcube types?
Thank you
When modifying mlcube.py, how should I set the data_path and output_path in the infer function? @msadi002 The problem might be misconfigured GPU drivers in your system. To remove other possibilities, please show me your `mlcube.yaml` file (`docker` section and `platform` section)
@kechen0207 That's right, you should upload your `mlcube_package.tar.gz`. As @vchung mention, "If an error is encountered next week, we will reach out via email.".
@huilin It seems that your MLCube is failing the compatibility test, i.e. the predictions generated by your model are not structured as expected (remember: given `N` cases in the input dataset, your model should generate exactly `N` nifti files to the output prediction folder, of the pattern `*{ID}_{timepoint}.nii.gz`) File "/mlcube_project/metrics.py", line 28, in check_for_segmentation
raise ValueError("Predictions number don't match labels")
ValueError: Predictions number don't match labels Dear organizers
I received an email that my mlcube submission 9739694 has been accepted. However, after a while it disappeared from the submission dashboard (Task 8: Inpainting). Is this normal?
Thank you!
@vchung Thanks for your reply. As you said, once the local compatibility tested is done without error, it is not likely to arise error with the testing data. But I wondering below command is right to use for the mlcube packaging?
python scripts/package-mlcube.py
\-\-mlcube path/to/mlcube
\-\-mlcube-types model
\-\-output path/to/file.tar.gz
And what I should upload to the project is the final compressed tarball file generated by this command. Is that right?
```
??? mlcube_package.tar.gz
??? mlcube.yaml
??? parameters.yaml
??? additional_files.tar.gz
```
More specifically, the file I need to upload is the **_mlcube_package.tar.gz_**, right?
In case any error happens occured in the testing phase. Will we receive an email and have a chance to fix? Hi, I am trying to made MLcube for my model,
my docker-file:
FROM nvcr.io/nvidia/pytorch:23.07-py3
RUN pip install nnunetv2
COPY trained_models /mlcube_project/trained_models/
COPY nnUNet_preprocessed /mlcube_project/nnUNet_preprocessed/
COPY nnUNet_raw_data /mlcube_project/nnUNet_raw_data/
COPY ./requirements.txt /mlcube_project/requirements.txt
RUN pip3 install --no-cache-dir -r /mlcube_project/requirements.txt
ENV nnUNet_results=/mlcube_project/trained_models/
ENV nnUNet_preprocessed=/mlcube_project/nnUNet_preprocessed/
ENV nnUNet_raw=/mlcube_project/nnUNet_raw_data/
ENV LANG C.UTF-8
COPY . /mlcube_project
ENTRYPOINT ["python3", "/mlcube_project/mlcube.py"]
getting this error:
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
2023-08-19 18:01:46 MAEUbuntuKH234 mlcube.shell[47990] ERROR Shell.run command='docker run --shm-size=2gb --gpus=all --volume /home/msadi002/BraTS2023_SSA:/mlcube_io0 --volume /home/msadi002/BraTS2023_SSA_output:/mlcube_io1 docker.synapse.org/syn52187109/brats_africa:0.2 infer --data_path=/mlcube_io0 --output_path=/mlcube_io1' status=32000 exit_status=exited exit_code=125 on_error=raise
2023-08-19 18:01:46 MAEUbuntuKH234 mlcube.__main__[47990] ERROR run failed to run MLCube with error code 125.
Traceback (most recent call last):
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube_docker/docker_run.py", line 333, in run
Shell.run(
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube/shell.py", line 99, in run
raise ExecutionError(
mlcube.errors.ExecutionError: Failed to execute shell command.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube/__main__.py", line 378, in run
runner.run()
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube_docker/docker_run.py", line 346, in run
raise ExecutionError.mlcube_run_error(
mlcube.errors.ExecutionError: DockerRun runner failed to run MLCube. Error occurred while running MLCube task (docker=docker, run_args=--shm-size=2gb --gpus=all, env_args=, volumes=--volume /home/msadi002/BraTS2023_SSA:/mlcube_io0 --volume /home/msadi002/BraTS2023_SSA_output:/mlcube_io1, image=docker.synapse.org/syn52187109/brats_africa:0.2, task_args=['infer', '--data_path=/mlcube_io0', '--output_path=/mlcube_io1']).
ERROR:
message: DockerRun runner failed to run MLCube.
description: Error occurred while running MLCube task (docker=docker, run_args=--shm-size=2gb --gpus=all, env_args=, volumes=--volume /home/msadi002/BraTS2023_SSA:/mlcube_io0 --volume /home/msadi002/BraTS2023_SSA_output:/mlcube_io1, image=docker.synapse.org/syn52187109/brats_africa:0.2, task_args=['infer', '--data_path=/mlcube_io0', '--output_path=/mlcube_io1']).
context: {'status': 'exited', 'code': 125, 'cmd': 'docker run --shm-size=2gb --gpus=all --volume /home/msadi002/BraTS2023_SSA:/mlcube_io0 --volume /home/msadi002/BraTS2023_SSA_output:/mlcube_io1 docker.synapse.org/syn52187109/brats_africa:0.2 infer --data_path=/mlcube_io0 --output_path=/mlcube_io1'}
Thank you @kechen0207 ,
Great question! No, a compatibility test has not been run against the testing data, so your MLCube may still be at risk of errors.
That being said, if your local compatibility test passes, then errors are not likely to arise with the testing data. If an error is encountered next week, we will reach out via email. Hi,
I have run the compatibility test locally.
After that, I followed the instruction to run this command.
python scripts/package-mlcube.py \
\-\-mlcube path/to/mlcube \
\-\-mlcube-types model \
\-\-output path/to/file.tar.gz
The contents in the generated tarball are "mlcube.yaml, parameters.yaml, additional_files.tar.gz".
If I understand right, the thing I should do is to upload the generated tarball file to a specific project. Is that right?
Meanwhile, I have received the status below:
Submission Status - MLCUBE_DOCKER_FOUND
Workflow Status - DONE
Does that mean my submission passed an online compatibility test and would have no problem when running on unseen testing data?
@ShadowTwin41 ,
I have invalidated your previous submissions made to the Adult Glioma queue. You may now resubmit your MLCube Docker images and config tarballs. @hasank @msadi002 -
Yes, that's right! You will want to use the Synapse ID of the project you uploaded your files to, as this ID will tell Synapse where to push your Docker image. If you use the challenge's Synapse ID (`syn51156910`), you will receive a permissions error. >Hi, I found that:
>[removed]: Synapse ID of your project. Is this is the ID when I created the project for validation file submission.
>Thank youu
That sounds about right. @vchung ? @msadi002 That should be fine! `parameters.yaml` and a configurable weights path are recommended for organizing code, but that's optional. I am assuming that your `project/mlcube.py` is not receiving an argument for model weights, that you hardcoded the path somewhere in your code.
Regarding your question about image, not correct. The synapse ID is **YOUR** project ID (which is the same for all challenges/tasks).
This was noted in the [submission tutorial](https://www.synapse.org/#!Synapse:syn51156910/wiki/622674), section "Upload Your MLCube"/"MLCube Docker Image"
Hi, I found that:
: Synapse ID of your project. Is this is the ID when I created the project for validation file submission.
Thank youu Hi, I successfully tested the compatibility in our side. But I did some changes:
I did not put my model weights under workspace/additional_files.
I put my model weights under project. Will it be an issue?
Additionally I did not use any parameters.yaml (its optional)
.
??? model_custom_cnn
??? mlcube
? ??? mlcube.yaml
? ??? workspace
? ??? additional_files
? ? ??? cnn_weights.pth
? ??? parameters.yaml
??? project
??? Dockerfile
??? mlcube.py
??? models.py
??? data_loader.py
??? infer.py
??? requirements.txt
The following is locally tested our side:
(medperf-env) msadi002@MAEUbuntuKH234:~/medperf/BraTS_Africa/mlcube$ ls
mlcube.yaml workspace
(medperf-env) msadi002@MAEUbuntuKH234:~/medperf/BraTS_Africa/mlcube$ cd /home/msadi002/test_mlcubes
(medperf-env) msadi002@MAEUbuntuKH234:~/test_mlcubes$ medperf test run \
> --demo_dataset_url synapse:syn52276402 \
> --demo_dataset_hash "16526543134396b0c8fd0f0428be7c96f2142a66" \
> -p ./prep_segmentation \
> -m ~/medperf/BraTS_Africa/mlcube \
> -e ./eval_segmentation \
> --offline --no-cache
MedPerf 0.1.0
Retrieving Model cube
> Model cube download complete
Retrieving Evaluator cube
> Evaluator cube download complete
Downloading [####################]100.00% 78.4MB/78.4MB (58.7MB/s) BraTS-GLI-fastlane.tar.gz.synapse_download_127811089 Done...
> Preparation cube download complete
> Cube execution complete
> Sanity checks complete
> Statistics complete
...Working on patient id: BraTS-GLI-00013-001
...Working on patient id: BraTS-GLI-00015-000
...Working on patient id: BraTS-GLI-00001-000
...Working on patient id: BraTS-GLI-00013-000
...Working on patient id: BraTS-GLI-00001-001
> Model execution complete
? Done!
Is this correct form :image=docker.synapse.org/syn51156910/brats-africa:0.1
or synID will be different for different task?
Thank you Hi @abhijeetparida
Add the `gpu_args` in `mlcube.yaml` in `docker` section as shown below and set its value to whatever args you wish to provide to `docker run`:
```yaml
platform:
accelerator_count: 1
docker:
# Image name
image: mlcommons/mock-model-brats:0.0.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"
gpu_args: --shm-size=2gb --gpus=all
```
Hope that this helps! Both `mlcube` and `medperf` should work fine with this configuration
@vchung,
The IDs are 9739604 and 9739597 for my two submissions.
Thank you very much! inorder to run my mlcube i am running the command
`mlcube run --task infer data_path= output_path=` I have replaced the paths with the correct way. I use the docker base image `pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime` and the mlcube `accelerator_count: 1`. Still, my inference script inside the docker cannot identify the CUDA. I need to be able to add the docker run equivalents of `--gpus=all` and `--shm-size=2gb`. how can I do that in the mlcube run? how does medperf take care of it? @ShadowTwin41 ,
Unfortunately, we are not able to increase the submission limit. However, we can invalidate and close one of your previous submissions so that you can submit your final one. If you would like to go with this route, please let me know which IDs I should close (MLCube tarball submission + Docker submission). Dear organizers,
I was able to perform the local testing. Thank you @hasank !
However, I already reached my submission cota, before realizing this warning from you:
"The docker image name configured in your mlcube.yaml file (found in your MLCube directory) should match the one uploaded in the previous step."
I've changed this already, but I can't submit again. Could you allow me to submit again?
Thank you very much! @abhijeetparida The synapse ID is your project ID (which is the same for all challenges/tasks)
This was noted in the [submission tutorial](https://www.synapse.org/#!Synapse:syn51156910/wiki/621282), section "Upload Your MLCube"/"MLCube Docker Image"
@msadi002 I see this error: `subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1.`
Which seems that your dockerfile is not properly configured with C++ to use pytorch? Maybe try installing gcc libraries in your dockerfile or use a docker base image provided by pytorch. Hi, I am running for inference and getting this error:
I built the environment on python:3.9.16-slim
But last year for the docker we used python 3.7.7 and it works.
raceback (most recent call last):
File "/mlcube_project/mlcube.py", line 3, in
from infer import main
File "/mlcube_project/infer.py", line 21, in
from utils.custom_neural_ODE import JPUNet
File "/mlcube_project/utils/custom_neural_ODE.py", line 11, in
from .encnet_1 import EncHead
File "/mlcube_project/utils/encnet_1.py", line 4, in
from .encoding import Encoding
File "/mlcube_project/utils/encoding.py", line 18, in
from .functions import scaled_l2, aggregate
File "/mlcube_project/utils/functions.py", line 15, in
from . import lib
File "/mlcube_project/utils/lib/__init__.py", line 10, in
cpu = load('enclib_cpu', [
File "/usr/local/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1284, in load
return _jit_compile(
File "/usr/local/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1509, in _jit_compile
_write_ninja_file_and_build_library(
File "/usr/local/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1598, in _write_ninja_file_and_build_library
get_compiler_abi_compatibility_and_version(compiler)
File "/usr/local/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 337, in get_compiler_abi_compatibility_and_version
if not check_compiler_ok_for_platform(compiler):
File "/usr/local/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 291, in check_compiler_ok_for_platform
which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
File "/usr/local/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1.
2023-08-18 16:41:22 MAEUbuntuKH234 mlcube.shell[14552] ERROR Shell.run command='docker run --volume /home/msadi002/BraTS_Africa_input:/mlcube_io0 --volume /home/msadi002/medperf/BraTS_Africa/mlcube/workspace:/mlcube_io1 --volume /home/msadi002/BraTS_Africa_output:/mlcube_io2 docker.synapse.org/syn51156910/brats-africa:0.1 infer --data_path=/mlcube_io0 --parameters_file=/mlcube_io1/parameters.yaml --output_path=/mlcube_io2' status=256 exit_status=exited exit_code=1 on_error=raise
2023-08-18 16:41:22 MAEUbuntuKH234 mlcube.__main__[14552] ERROR run failed to run MLCube with error code 1.
Traceback (most recent call last):
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube_docker/docker_run.py", line 333, in run
Shell.run(
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube/shell.py", line 99, in run
raise ExecutionError(
mlcube.errors.ExecutionError: Failed to execute shell command.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube/__main__.py", line 378, in run
runner.run()
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube_docker/docker_run.py", line 346, in runs their any co
raise ExecutionError.mlcube_run_error(
mlcube.errors.ExecutionError: DockerRun runner failed to run MLCube. Error occurred while running MLCube task (docker=docker, run_args=, env_args=, volumes=--volume /home/msadi002/BraTS_Africa_input:/mlcube_io0 --volume /home/msadi002/medperf/BraTS_Africa/mlcube/workspace:/mlcube_io1 --volume /home/msadi002/BraTS_Africa_output:/mlcube_io2, image=docker.synapse.org/syn51156910/brats-africa:0.1, task_args=['infer', '--data_path=/mlcube_io0', '--parameters_file=/mlcube_io1/parameters.yaml', '--output_path=/mlcube_io2']).
ERROR:
message: DockerRun runner failed to run MLCube.
description: Error occurred while running MLCube task (docker=docker, run_args=, env_args=, volumes=--volume /home/msadi002/BraTS_Africa_input:/mlcube_io0 --volume /home/msadi002/medperf/BraTS_Africa/mlcube/workspace:/mlcube_io1 --volume /home/msadi002/BraTS_Africa_output:/mlcube_io2, image=docker.synapse.org/syn51156910/brats-africa:0.1, task_args=['infer', '--data_path=/mlcube_io0', '--parameters_file=/mlcube_io1/parameters.yaml', '--output_path=/mlcube_io2']).
context: {'status': 'exited', 'code': 1, 'cmd': 'docker run --volume /home/msadi002/BraTS_Africa_input:/mlcube_io0 --volume /home/msadi002/medperf/BraTS_Africa/mlcube/workspace:/mlcube_io1 --volume /home/msadi002/BraTS_Africa_output:/mlcube_io2 docker.synapse.org/syn51156910/brats-africa:0.1 infer --data_path=/mlcube_io0 --parameters_file=/mlcube_io1/parameters.yaml --output_path=/mlcube_io2'}
Thank you
@hasank `docker.synapse.org//:` which is the different synID for the tasks I should be using? and where do I find them? @abhijeetparida Please provide some context about your question. @huilin Can you please provide the full error output that got printed? If it's big, please create a separate thread. Which is the synapseid that i should be using? One more error when I am testing medperf test run
message: DockerRun runner failed to run MLCube.
description: Error occurred while running MLCube task (docker=docker, run_args= --network=none, env_args=, volumes=--volume /home/hln0895/.medperf/api_medperf_org/data/72d37eb6bd4ecd17cb3ecc04c57c4fefa6b02e26/data:/mlcube_io0 --volume .......
? Model MLCube failed.
docker version24.0.5
{"hash": "33f712fba8b7740e75d5d823955b951fd478dcc339f69ce581f3f838e34df84c"}
@lulululu That's right, thanks!
@msadi002 as @lulululu mentioned: https://docs.medperf.org/mlcubes/mlcube_models/#prepare-your-dockerfile:~:text=The%20infer%20command,the%20necessary%20arguments.
Hi @msadi002
If I understand it correctly the error is because you have not modified this part
```
# Modify the infer command as needed
raise NotImplementedError("The infer method is not yet implemented")
```
of the mlcube.py script (i guess you should modify this part such that it starts your inference method)
Hi, I am able to create the Mlcube. I am getting this error while I run this. Please find the following mlcube.py and mlcube.yaml:
**mlcube.py:**
"""MLCube handler file"""
import typer
app = typer.Typer()
@app.command("infer")
def infer(
data_path: str = typer.Option(..., "--data_path"),
#parameters_file: str = typer.Option(..., "--parameters_file"),
output_path: str = typer.Option(..., "--output_path"),
# Provide additional parameters as described in the mlcube.yaml file
# e.g. model weights:
# weights: str = typer.Option(..., "--weights"),
):
# Modify the infer command as needed
raise NotImplementedError("The infer method is not yet implemented")
@app.command("hotfix")
def hotfix():
# NOOP command for typer to behave correctly. DO NOT REMOVE OR MODIFY
pass
if __name__ == "__main__":
app()
**mlcube.yaml:**
name: UNCE_NODE
description: SSA_Africa Segmentaation
authors:
- {name: shibly}
platform:
accelerator_count: 1
docker:
# Image name
image: docker.synapse.org/syn51156910/brats-africa:0.1
# 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: {"""MLCube handler file"""
import typer
app = typer.Typer()
@app.command("infer")
def infer(
data_path: str = typer.Option(..., "--data_path"),
#parameters_file: str = typer.Option(..., "--parameters_file"),
output_path: str = typer.Option(..., "--output_path"),
# Provide additional parameters as described in the mlcube.yaml file
# e.g. model weights:
# weights: str = typer.Option(..., "--weights"),
):
# Modify the infer command as needed
raise NotImplementedError("The infer method is not yet implemented")
@app.command("hotfix")
def hotfix():
# NOOP command for typer to behave correctly. DO NOT REMOVE OR MODIFY
pass
if __name__ == "__main__":
app()
data_path: data/,
parameters_file: parameters.yaml,
# Feel free to include other files required for inference.
# These files MUST go inside the additional_files path.
# e.g. model weights
# weights: additional_files/weights.pt,
}
outputs: {output_path: {type: directory, default: predictions}}
mlcube run --task infer data_path='/home/msadi002/BraTS_Africa_input' output_path='/home/msadi002/BraTS_Africa_output'
Traceback (most recent call last):
File "/mlcube_project/mlcube.py", line 28, in
app()
File "/mlcube_project/mlcube.py", line 18, in infer
raise NotImplementedError("The infer method is not yet implemented")
NotImplementedError: The infer method is not yet implemented
2023-08-18 12:42:29 MAEUbuntuKH234 mlcube.shell[10921] ERROR Shell.run command='docker run --volume /home/msadi002/BraTS_Africa_input:/mlcube_io0 --volume /home/msadi002/medperf/BraTS_Africa/mlcube/workspace:/mlcube_io1 --volume /home/msadi002/BraTS_Africa_output:/mlcube_io2 docker.synapse.org/syn51156910/brats-africa:0.1 infer --data_path=/mlcube_io0 --parameters_file=/mlcube_io1/parameters.yaml --output_path=/mlcube_io2' status=256 exit_status=exited exit_code=1 on_error=raise
2023-08-18 12:42:29 MAEUbuntuKH234 mlcube.__main__[10921] ERROR run failed to run MLCube with error code 1.
Traceback (most recent call last):
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube_docker/docker_run.py", line 333, in run
Shell.run(
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube/shell.py", line 99, in run
raise ExecutionError(
mlcube.errors.ExecutionError: Failed to execute shell command.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube/__main__.py", line 378, in run
runner.run()
File "/home/msadi002/anaconda3/envs/medperf-env/lib/python3.9/site-packages/mlcube_docker/docker_run.py", line 346, in run
raise ExecutionError.mlcube_run_error(
mlcube.errors.ExecutionError: DockerRun runner failed to run MLCube. Error occurred while running MLCube task (docker=docker, run_args=, env_args=, volumes=--volume /home/msadi002/BraTS_Africa_input:/mlcube_io0 --volume /home/msadi002/medperf/BraTS_Africa/mlcube/workspace:/mlcube_io1 --volume /home/msadi002/BraTS_Africa_output:/mlcube_io2, image=docker.synapse.org/syn51156910/brats-africa:0.1, task_args=['infer', '--data_path=/mlcube_io0', '--parameters_file=/mlcube_io1/parameters.yaml', '--output_path=/mlcube_io2']).
ERROR:
message: DockerRun runner failed to run MLCube.
description: Error occurred while running MLCube task (docker=docker, run_args=, env_args=, volumes=--volume /home/msadi002/BraTS_Africa_input:/mlcube_io0 --volume /home/msadi002/medperf/BraTS_Africa/mlcube/workspace:/mlcube_io1 --volume /home/msadi002/BraTS_Africa_output:/mlcube_io2, image=docker.synapse.org/syn51156910/brats-africa:0.1, task_args=['infer', '--data_path=/mlcube_io0', '--parameters_file=/mlcube_io1/parameters.yaml', '--output_path=/mlcube_io2']).
context: {'status': 'exited', 'code': 1, 'cmd': 'docker run --volume /home/msadi002/BraTS_Africa_input:/mlcube_io0 --volume /home/msadi002/medperf/BraTS_Africa/mlcube/workspace:/mlcube_io1 --volume /home/msadi002/BraTS_Africa_output:/mlcube_io2 docker.synapse.org/syn51156910/brats-africa:0.1 infer --data_path=/mlcube_io0 --parameters_file=/mlcube_io1/parameters.yaml --output_path=/mlcube_io2'}
Thank you @msadi002
For your first question, I see this error: `Error response from daemon: dockerfile parse error line 1: FROM requires either one or three arguments`. This seems to be a syntax error in your dockerfile, and not an MLCube-related thing. Please make sure your dockerfile is valid.
For the second question, it should be fine **but I suggest that **from the beginning you use the final docker image name as [specified here](https://www.synapse.org/#!Synapse:syn51156910/wiki/622674:~:text=%22Re%2Dname%22%20the%20image%20by%20creating%20a%20new%20tag%3A), i.e. `docker.synapse.org//:`. This way, you will avoid later re-tagging the docker image and updating the `mlcube.yaml` file with the edited docker image name Hi,
During the preparation of Mlcube:
project_name [Model MLCube]: Custom CNN Classification Model
project_slug [model_mlcube]: model_custom_cnn
description [Model MLCube Template. Provided by MLCommons]: MedPerf Tutorial - Model MLCube.
author_name [John Smith]: