qurit-frizi / TMTV-Net

This repository employs a deep-learning method for the automated segmentation of total metabolic tumor volume (TMTV) in whole-body [18]F-FDG PET/CT images, with an emphasis on multi-center generalizability.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't run inference on my data

mprires opened this issue · comments

Hi! I came across your publication and wanted to try your segmentation approach on my data. I tried running the line
python3 main.py -h however I couldn't get it to work. I'm on Ubuntu 22.04 and python3.9. Also tried to run it within the docker container but it was also not successful and got the same error. Below you can find a screenshot of the error.

Thanks in advance for your help!

Screenshot 2024-02-15 at 11 59 17

The version of monai used is not the latest, it uses the "dimensions" keyword in UNet which was deprecated in 0.6.0 and removed in 1.2.0. The stable version is 1.3.0.
Specifying the version to 1.1.0 in the requirements.txt file is a quick fix for your problem.

Other packages are missing from this file for the moment, I managed to get it to run with the following requirements.txt:

# pip dependent 
torch
SimpleITK
numpy
monai==1.1.0
scikit-image
scikit-learn
matplotlib
bokeh==2.4.3
lz4
pandas
md2pdf
pydicom
rt_utils
nibabel
mdutils
tqdm
scipy
pytz

I would recommend the following additions to the Dockerfile as well:

# base docker image:
FROM python:3.9

# label the docker image:
LABEL Name="petnet"  

# define working directory inside the docker image:
WORKDIR /src

# Copy everything in the current directory into the docker image working directory.
COPY . .


# Assume requirements.txt was in the current directory, install dependencies that require pip install:
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6  -y
RUN pip install --upgrade pip 
RUN pip install -r requirements.txt
ADD in_tmtvnet /input
ADD out_tmtvnet /output
ENV RAIVEN_INPUT_DIR=/input
ENV RAIVEN_OUTPUT_DIR=/output
ENV JOB_ID=0
ENV RUN_ID=0
ENV CONTAINER_NAME=DEBUG

# Run the main python code when the container is started:# 
CMD python main.py

You should create in_tmtvnet and out_tmtvnet.
I have other problems down the line, but this should get you started!

Have a nice day!

Hi @Zhack47 Thank you for your help! Will try your fixes :)