Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StopIteration Error while training patches #6

Open
HbueSky opened this issue Apr 9, 2018 · 6 comments
Open

StopIteration Error while training patches #6

HbueSky opened this issue Apr 9, 2018 · 6 comments

Comments

@HbueSky
Copy link

HbueSky commented Apr 9, 2018

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
Copy link
Author

HbueSky commented Apr 9, 2018

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
Copy link
Owner

lishen commented Apr 12, 2018

Well, you shall use sample_patches_combined.py.

@HbueSky
Copy link
Author

HbueSky commented Apr 12, 2018

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
Copy link

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
Copy link

@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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants