woodywff / brats_2019

A 3D U-Net Based Solution to BraTS 2019 in Keras
https://arxiv.org/abs/1909.12901
GNU General Public License v3.0
49 stars 15 forks source link

程序运行顺序 #7

Open qiuyuan666 opened 4 years ago

qiuyuan666 commented 4 years ago

感谢您开源您们的代码,我是先读了您的文章才找到这个开源代码的,我想用您的代码来实现MRI分割(数据集是brats2019的训练数据和验证数据)。 想问您几个问题: 1.先运行preprocess.py对数据集进行n4 bias校正和归一化处理是么?我如果不进行n4 bias 校正,要重新设置哪些参数?而且不管是否进行n4 bias 校正,预处理后的数据格式都是一样的吗? 2.接下来运行run_validation.py,再运行evaluate.py进行评价吗? 3.能否注释一下每个.py文件的功能?

问您这么多问题,还望您见谅,也麻烦您可以解答一下

woodywff commented 4 years ago

您好,1. n4 bias is not necessary in this project; 不用n4 bias校正就在normalize_image(in_file, out_file, bias_correction=True)中置bias_correction=False; n4 bias不影响数据格式.

  1. 运行顺序可以参考demo_task1/demo_run.ipynb.
  2. I will do it when I'm free in the future. Keep working and Good luck!
qiuyuan666 commented 4 years ago

您好,又来打扰您啦~ 运行train_model.py遇到的问题: 1.运行到第152行,get_training_and_validation_generators( )函数时会进入generator.py执行该函数,执行完毕后发现读取的datafile是生成的data"文件夹下的data.h5文件,显示training_list, validation_list,num_patches_training,num_patches_val都是0,这是因为根本没有读取到数据吧? 在运行之前没有单独运行process.py,没有做预处理将数据存在对应文件夹,所以generator.py里的函数就没读到数据吗?

2.继续运行到第177行进入train_model( )函数后就一直在这个函数里不动了,具体显示如下: WARNING:tensorflow:From /home/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. Backend TkAgg is interactive backend. Turning interactive mode on. Loading previous validation split... Number of training steps in each epoch: 1 Number of validation steps in each epoch: 1 WARNING:tensorflow:From /home/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. Epoch 1/300

这里一直等了一天一夜都没有反应,请问这是为啥?

3.运行train_model.py后生成了几个文件分别是:data.h5/list_cv1_train.pkl/list_cv1_val.pkl/mean_std.pkl/survival_data.csv,这几个文件分别是什么?

期待您的解答【抱拳.jpg】

qiuyuan666 commented 4 years ago

您好,我运行了预处理的代码,预处理后的数据存放目录和您的original_tree对比后是一样的。然后我重新运行了train_model.py,但是还是training_list, validation_list,num_patches_training,num_patches_val都是0,运行后结果如下: ‘’‘ totalMemory: 7.79GiB freeMemory: 7.35GiB 2020-10-09 15:34:57.603044: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0 2020-10-09 15:34:57.604181: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-10-09 15:34:57.604200: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0 2020-10-09 15:34:57.604211: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N 2020-10-09 15:34:57.604299: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device WARNING:tensorflow:From /home/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version. Instructions for updating: Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob. Loading previous validation split... Number of training steps in each epoch: 1 Number of validation steps in each epoch: 1 WARNING:tensorflow:From /home/qiuyuan/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. Epoch 1/300

Process finished with exit code 139(interrupted by signal 11:SIGSEGV) ’‘’ (1)想问一下这里为什么一直读取不到数据呢?可以指点一下吗?