sergivalverde / nicMSlesions

Easy multiple sclerosis white matter lesion segmentation using convolutional deep neural networks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unknown error

zswgzx opened this issue · comments

I'm trying to perform inference using the pre-trained model, but have the following error.

configuration options:

modalities : ['FLAIR', 'T1']
fract_negative_positive : 2.0
test_folder : /path/to/testing
weight_paths : None
load_weights : True
t_bin : 0.5
min_error : 0.5
num_layers : None
max_epochs : 400
pretrained_model : baseline_2ch
image_tags : ['flair', 't1']
gpu_number : 2
denoise_iter : 3
roi_tags : ['lesion']
register_modalities : True
save_tmp : True
denoise : True
output_folder : /output
experiment : baseline_2ch
mod3_tags : ['None']
t1_tags : ['t1']
batch_size : 128
x_names : ['FLAIR_brain.nii.gz', 'T1_brain.nii.gz']
current_scan : scan
full_train : False
train_folder : /path/to/training
mod4_tags : ['None']
skull_stripping : True
net_verbose : 1
patience : 50
flair_tags : ['flair']
patch_size : (11, 11, 11)
balanced_training : False
l_min : 10
out_name : out_seg.nii.gz
min_th : 0.5
debug : True
randomize_train : True
train_split : 0.25
pretrained : None
fully_convolutional : False

DEBUG: 2
Using TensorFlow backend.
Traceback (most recent call last):
File "nic_infer_segmentation_batch.py", line 97, in
model = cascade_model(options)
File "/home/docker/src/libs/CNN/build_model.py", line 95, in cascade_model
model = get_network(options)
File "/home/docker/src/libs/CNN/nets.py", line 24, in get_network
net_input = Input(name='in1', shape=(channels,) + options['patch_size'])
File "/miniconda/lib/python2.7/site-packages/keras/engine/topology.py", line 1375, in Input
input_tensor=tensor)
File "/miniconda/lib/python2.7/site-packages/keras/engine/topology.py", line 1286, in init
name=self.name)
File "/miniconda/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 349, in placeholder
x = tf.placeholder(dtype, shape=shape, name=name)
AttributeError: 'module' object has no attribute 'placeholder'

docker@19764b608857:~/src$ ls
init.py config nets utils
app.py libs nic_infer_segmentation_batch.py
cnn_scripts.py logonic.png nic_train_network_batch.py

GPU is completely new to me, so any help would be appreciated.

Hi, If you are using the docker, then you don't have to install anything apart from docker and be sure that the machine running the code has the proper nvidia-drivers and cuda. I would encourage to use this version of nicmslesions:

Then go to nicmslesions and follow the instructions. It's basically using a docker file from the Docker hub and running everything from a shell script. We have this version running in several machines without problems.

Let met know,
s

It's run on NVIDIA Corporation GK210GL [Tesla K80] (rev a1). I installed nvidia driver 384 and cuda-9-0 (https://www.tensorflow.org/install/gpu#ubuntu_1604_cuda_90_for_tensorflow_1130, checked with nvidia-smi). libcudnn7=7.0.3.11-1+cuda9.0. cuda-repo-ubuntu1604_9.0.176-1_amd64.deb.

If Docker image is NOT used, try to install the required python packages first (keras instroduced tensorflow/tensorboard2.0.0, and should be uninstalled), then install tensorflow-gpu.

Everything looks good so far. Thanks again Sergi.