xmengli / H-DenseUNet

TMI 2018. H-DenseUNet: Hybrid Densely Connected UNet for Liver and Tumor Segmentation from CT Volumes
527 stars 161 forks source link

some question about train_2ddense.py #24

Open magicdream2222 opened 5 years ago

magicdream2222 commented 5 years ago

hi, i am very interested in your work, but i have a question about the code in train_2ddense.py

    minindex[0] = max(minindex[0] - 3, 0)
    minindex[1] = max(minindex[1] - 3, 0)
    minindex[2] = max(minindex[2] - 3, 0)
    maxindex[0] = min(img.shape[0], maxindex[0] + 3)
    maxindex[1] = min(img.shape[1], maxindex[1] + 3)
    maxindex[2] = min(img.shape[2], maxindex[2] + 3)

I can't understand why it's subtract and add 3, why not other number?

Apple-zly commented 5 years ago

Hello, I don't know what is the meaning of the following code? liverlist is what? num = np.random.randint(0,6) if num < 3 or (count in liverlist): lines = liverlines[count] numid = liveridx[count] else: lines = tumorlines[count] numid = tumoridx[count]

magicdream2222 commented 5 years ago

count

hi, this code is make one batch contains 50% liver image and 50% tumor image. liverlist is the ct which can't have tumor

Apple-zly commented 5 years ago

hello, Thank you very much!
I don't know what is the meaning of the following code? a = min(max(minindex[0] + deps/2, cen[0]), maxindex[0]- deps/2-1) b = min(max(minindex[1] + rows/2, cen[1]), maxindex[1]- rows/2-1) c = min(max(minindex[2] + cols/2, cen[2]), maxindex[2]- cols/2-1)

xmengli commented 5 years ago

Find the location to crop images.

On Mon, Apr 29, 2019 at 9:55 AM Apple-zly notifications@github.com wrote:

hello, Thank you very much! I don't know what is the meaning of the following code? a = min(max(minindex[0] + deps/2, cen[0]), maxindex[0]- deps/2-1) b = min(max(minindex[1] + rows/2, cen[1]), maxindex[1]- rows/2-1) c = min(max(minindex[2] + cols/2, cen[2]), maxindex[2]- cols/2-1)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xmengli999/H-DenseUNet/issues/24#issuecomment-487434880, or mute the thread https://github.com/notifications/unsubscribe-auth/AESGZSCE6DC5JX7QZMVSAS3PSZIRZANCNFSM4HHLFQ2A .

Apple-zly commented 5 years ago

Hello, I run the train_2ddenseunet, it is StopIterators. It is relation with the pool(thread_num), fit_gerator(workers)? I want to know the relation about pool(thread_num), fit_gerator(workers). Because my cpu and gpu is limited, I load data is by batch, then by generator to train. infinite....

1/1711 [..............................] - ETA: 547208s - loss: 0.1421 - acc: 2/1711 [..............................] - ETA: 273914s - loss: 0.1670 - acc: 0.5536(16, 224, 224, 3) (16, 224, 224, 1) 3/1711 [..............................] - ETA: 226099s - loss: 0.1711 - acc: 0.5572(16, 224, 224, 3) (16, 224, 224, 1) 4/1711 [..............................] - ETA: 182167s - loss: 0.1564 - acc: 0.5683 Traceback (most recent call last): File "batch2.py", line 211, in train_and_predict() File "batch2.py", line 201, in train_and_predict train_loss, train_acc = model.fit_generator(generate_arrays_from_file(args.b), steps_per_epoch=steps, epochs=60, verbose=1, callbacks=[model_checkpoint], max_queue_size=10, workers=3, use_multiprocessing=True) File "/usr/local/lib/python3.6/dist-packages/Keras-2.0.8-py3.6.egg/keras/legacy/interfaces.py", line 87, in wrapper File "/usr/local/lib/python3.6/dist-packages/Keras-2.0.8-py3.6.egg/keras/engine/training.py", line 2011, in fit_generator StopIteration

magicdream2222 commented 5 years ago

Hello, I run the train_2ddenseunet, it is StopIterators. It is relation with the pool(thread_num), fit_gerator(workers)? I want to know the relation about pool(thread_num), fit_gerator(workers). Because my cpu and gpu is limited, I load data is by batch, then by generator to train. infinite....

1/1711 [..............................] - ETA: 547208s - loss: 0.1421 - acc: 2/1711 [..............................] - ETA: 273914s - loss: 0.1670 - acc: 0.5536(16, 224, 224, 3) (16, 224, 224, 1) 3/1711 [..............................] - ETA: 226099s - loss: 0.1711 - acc: 0.5572(16, 224, 224, 3) (16, 224, 224, 1) 4/1711 [..............................] - ETA: 182167s - loss: 0.1564 - acc: 0.5683 Traceback (most recent call last): File "batch2.py", line 211, in train_and_predict() File "batch2.py", line 201, in train_and_predict train_loss, train_acc = model.fit_generator(generate_arrays_from_file(args.b), steps_per_epoch=steps, epochs=60, verbose=1, callbacks=[model_checkpoint], max_queue_size=10, workers=3, use_multiprocessing=True) File "/usr/local/lib/python3.6/dist-packages/Keras-2.0.8-py3.6.egg/keras/legacy/interfaces.py", line 87, in wrapper File "/usr/local/lib/python3.6/dist-packages/Keras-2.0.8-py3.6.egg/keras/engine/training.py", line 2011, in fit_generator StopIteration

hi, Can you share your memory size? Because my server's memory is 64GB, it throw out of memory when run this program.

Apple-zly commented 5 years ago

Hello, I run the train_2ddenseunet, it is StopIterators. It is relation with the pool(thread_num), fit_gerator(workers)? I want to know the relation about pool(thread_num), fit_gerator(workers). Because my cpu and gpu is limited, I load data is by batch, then by generator to train. infinite.... 1/1711 [..............................] - ETA: 547208s - loss: 0.1421 - acc: 2/1711 [..............................] - ETA: 273914s - loss: 0.1670 - acc: 0.5536(16, 224, 224, 3) (16, 224, 224, 1) 3/1711 [..............................] - ETA: 226099s - loss: 0.1711 - acc: 0.5572(16, 224, 224, 3) (16, 224, 224, 1) 4/1711 [..............................] - ETA: 182167s - loss: 0.1564 - acc: 0.5683 Traceback (most recent call last): File "batch2.py", line 211, in train_and_predict() File "batch2.py", line 201, in train_and_predict train_loss, train_acc = model.fit_generator(generate_arrays_from_file(args.b), steps_per_epoch=steps, epochs=60, verbose=1, callbacks=[model_checkpoint], max_queue_size=10, workers=3, use_multiprocessing=True) File "/usr/local/lib/python3.6/dist-packages/Keras-2.0.8-py3.6.egg/keras/legacy/interfaces.py", line 87, in wrapper File "/usr/local/lib/python3.6/dist-packages/Keras-2.0.8-py3.6.egg/keras/engine/training.py", line 2011, in fit_generator StopIteration

hi, Can you share your memory size? Because my server's memory is 64GB, it throw out of memory when run this program.

hello, my server‘s memory is 62G. I want to know what I should do to solve this proplem.

larry-11 commented 4 years ago

Hello, I run the train_2ddenseunet, it is StopIterators. It is relation with the pool(thread_num), fit_gerator(workers)? I want to know the relation about pool(thread_num), fit_gerator(workers). Because my cpu and gpu is limited, I load data is by batch, then by generator to train. infinite.... 1/1711 [..............................] - ETA: 547208s - loss: 0.1421 - acc: 2/1711 [..............................] - ETA: 273914s - loss: 0.1670 - acc: 0.5536(16, 224, 224, 3) (16, 224, 224, 1) 3/1711 [..............................] - ETA: 226099s - loss: 0.1711 - acc: 0.5572(16, 224, 224, 3) (16, 224, 224, 1) 4/1711 [..............................] - ETA: 182167s - loss: 0.1564 - acc: 0.5683 Traceback (most recent call last): File "batch2.py", line 211, in train_and_predict() File "batch2.py", line 201, in train_and_predict train_loss, train_acc = model.fit_generator(generate_arrays_from_file(args.b), steps_per_epoch=steps, epochs=60, verbose=1, callbacks=[model_checkpoint], max_queue_size=10, workers=3, use_multiprocessing=True) File "/usr/local/lib/python3.6/dist-packages/Keras-2.0.8-py3.6.egg/keras/legacy/interfaces.py", line 87, in wrapper File "/usr/local/lib/python3.6/dist-packages/Keras-2.0.8-py3.6.egg/keras/engine/training.py", line 2011, in fit_generator StopIteration

hi, Can you share your memory size? Because my server's memory is 64GB, it throw out of memory when run this program.

hello, my server‘s memory is 62G. I want to know what I should do to solve this proplem.

Same problem. Have you solved it? thx!

dxs66 commented 3 years ago

hi, i am very interested in your work, but i have a question about the code in train_2ddense.py

    minindex[0] = max(minindex[0] - 3, 0)
    minindex[1] = max(minindex[1] - 3, 0)
    minindex[2] = max(minindex[2] - 3, 0)
    maxindex[0] = min(img.shape[0], maxindex[0] + 3)
    maxindex[1] = min(img.shape[1], maxindex[1] + 3)
    maxindex[2] = min(img.shape[2], maxindex[2] + 3)

I can't understand why it's subtract and add 3, why not other number?

Me too, and how these codes roles are?