lishen / end2end-all-conv

Deep Learning to Improve Breast Cancer Detection on Screening Mammography
Other
367 stars 126 forks source link

StopIteration Error while training patches #6

Open HbueSky opened 6 years ago

HbueSky commented 6 years ago

Hi, I have sampled all the images to get the patches, and put them into the train, val, and test directory, each directory has three subdirectories: backround, benign and malignant patches. But when i run the sample_patches_main.py, i get the error. Can you help me solve the problem? Thanks a lot!

Here is the error: Traceback (most recent call last): File "patch_clf_train.py", line 313, in run(args.train_dir, args.val_dir, args.test_dir, run_opts) File "patch_clf_train.py", line 155, in run hidden_dropout2=hidden_dropout2) File "/home//end2end-all-conv-master/ddsm_train/dm_keras_ext.py", line 304, in do_3stage_training verbose=2) File "/home/*/anaconda2/envs/tensorflow/lib/python2.7/site-packages/keras/legacy/interfaces.py", line 91, in wrapper return func(args, kwargs) File "/home//anaconda2/envs/tensorflow/lib/python2.7/site-packages/keras/engine/training.py", line 2192, in fit_generator generator_output = next(output_generator) File "/home//anaconda2/envs/tensorflow/lib/python2.7/site-packages/keras/utils/data_utils.py", line 584, in get six.raise_from(StopIteration(e), e) File "/home//anaconda2/envs/tensorflow/lib/python2.7/site-packages/six.py", line 737, in raise_from raise value StopIteration

HbueSky commented 6 years ago

In addition, ***/dm_keras_ext.py", line 304, hist = model.fit_generator( train_generator, steps_per_epoch=steps_per_epoch, epochs=nb_epoch, class_weight=class_weight, validation_data=validation_set, validation_steps=validation_steps, callbacks=callbacks, nb_worker=nb_worker, pickle_safe=pickle_safe, verbose=2)

lishen commented 6 years ago

Well, you shall use sample_patches_combined.py.

HbueSky commented 6 years ago

Sorry, I have just made a mistake. The error was occured when I run patch_clf_train, not sample_patches_main. I have sampled both the mass and calc patches which divided into five categories: 'background', 'calc_mal', 'calc_ben', 'mass_mal', 'mass_ben'. But in the trainning model, It's divided into three classes: background, maligant, benign. Thus, I just combined the calc_mal and mass_mal to be malignant. It's the same as benign and background.

ChaoLi977 commented 5 years ago

I am also confused about the number of categories in patch_clf_train.py, It seems that the number should be 5 according to the paper. Have you run through the patch_clf_train? @HbueSky

wurenzhong commented 5 years ago

@ChaoLi977 Yeah!you are right, there are five categories in the paper, but from the code, the class_list=['background', 'malignant', 'benign'], my approach is to merge mass_mal and calc_mal together, and renamed as malignant. And then~ Here cames the point, it failed, haw-haw, I'm sorry, I'm not here to solve your problem, but to raise mine, I hope you can run it quickly and share your experience. The following is my running error, the sincerity anticipates your reply, thanks! image

Tfatima7464 commented 2 years ago

I am also confused about the number of categories in patch_clf_train.py, It seems that the number should be 5 according to the paper. Have you run through the patch_clf_train? @HbueSky

hy .... did u able to run the complete code file?