-
Notifications
You must be signed in to change notification settings - Fork 330
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
when i was training my data,there is a issue exist as follow:> d:\orgin\faster-rcnn-tensorflow-python3.5-master\faster-rcnn-tensorflow-python3.5-master\lib\layer_utils\proposal_target_layer.py(139)_sample_rois() -> keep_inds = np.append(fg_inds, bg_inds) (Pdb) #31
Comments
i met the same problem. |
@Jasonxu033 there is a problem in my dataset |
@tdf1995 what problem? |
I met the same problem. keep_inds = np.append(fg_inds, bg_inds) (Pdb), did you solve it? |
@niuniu111 Some probles in your dateset. There are some pictures couldnot fit the annotation. |
I use VGG16 to run normally. When running RESNET, there is a similar error. Does this mean that the data is OK? |
@niuniu111 sorry i didn't try resnet |
I changed the learning rate from 0.0001 to 0.1,then the (Pdb) error occurs, I hope it will help you |
For me, this error occurs randomly. I have trained entire pascal voc before yet the second day when I tried to train the network, I saw this error message. I don't think it is code which is problematic. This might because my GPU or RAM are not stable. Try to run it on another device. |
It's hopeful,Thanks |
imdb.append_flipped_images() Will this code affect? |
|
Is training your own data set? |
You can try to reduce the value of SCALES. |
I tried it, is it modified in config.py? How much is it appropriate to change the value of SCALES? |
I use SCALES = [1,2,4,8,16], RATIOS = [0.5,1,2], you can try it. |
The picture I used for training is a grayscale image.According to what you said, using SCALES = [1,2,4,8,16], RATIOS = [0.5,1,2] will not work.As shown.After entering c, this result appears |
Have you solved this problem later? I have encountered this problem again today. |
same question,have you solved it?? |
same question, have you solved this problem? What is the reason? |
I also meet the question,I want to know what mean "there are some pictures could not fit the annotation."can you answer the question specifically? |
Same question |
It seems to be caused by the following lines if fg_inds.size > 0 and bg_inds.size > 0:
fg_rois_per_image = min(fg_rois_per_image, fg_inds.size)
fg_inds = npr.choice(fg_inds, size=int(fg_rois_per_image), replace=False)
bg_rois_per_image = rois_per_image - fg_rois_per_image
to_replace = bg_inds.size < bg_rois_per_image
bg_inds = npr.choice(bg_inds, size=int(bg_rois_per_image), replace=to_replace)
elif fg_inds.size > 0:
to_replace = fg_inds.size < rois_per_image
fg_inds = npr.choice(fg_inds, size=int(rois_per_image), replace=to_replace)
fg_rois_per_image = rois_per_image
elif bg_inds.size > 0:
to_replace = bg_inds.size < rois_per_image
bg_inds = npr.choice(bg_inds, size=int(rois_per_image), replace=to_replace)
fg_rois_per_image = 0
else:
import pdb
pdb.set_trace() # <----- this command launches python debugger and so it stops execution
# The indices that we're selecting (both fg and bg)
keep_inds = np.append(fg_inds, bg_inds) Even if the error refers to the append the stop is caused by pdb.set_trace(). That line of code was put there probably to debug some unwanted situation regarding overlapping buonding boxes |
I solved by raising an exception instead of opening pdb (in lib/layer_util/proposal_target_layer.py) if fg_inds.size > 0 and bg_inds.size > 0:
fg_rois_per_image = min(fg_rois_per_image, fg_inds.size)
fg_inds = npr.choice(fg_inds, size=int(fg_rois_per_image), replace=False)
bg_rois_per_image = rois_per_image - fg_rois_per_image
to_replace = bg_inds.size < bg_rois_per_image
bg_inds = npr.choice(bg_inds, size=int(bg_rois_per_image), replace=to_replace)
elif fg_inds.size > 0:
to_replace = fg_inds.size < rois_per_image
fg_inds = npr.choice(fg_inds, size=int(rois_per_image), replace=to_replace)
fg_rois_per_image = rois_per_image
elif bg_inds.size > 0:
to_replace = bg_inds.size < rois_per_image
bg_inds = npr.choice(bg_inds, size=int(rois_per_image), replace=to_replace)
fg_rois_per_image = 0
else:
raise Exception() and catching it in train.py # Compute the graph with summary
try:
rpn_loss_cls, rpn_loss_box, loss_cls, loss_box, total_loss = self.net.train_step(sess, blobs, train_op)
except Exception:
print('image invalid, skipping')
continue |
if you are using pascal_voc.py to deal with your dataset, you can try to remove |
when I use your approach, an exception is rainsing,which is proved image is wrong?@morpheusthewhite |
@niuniu111 yes, it is raised every time something in your dataset is not correct. |
that's mean your fg & bg all return 0.. |
that's mean your fg & bg all return 0.. |
i solve it. |
@morpheusthewhite can you send your changes as PR? |
This problem appears after completing several rounds of training
The text was updated successfully, but these errors were encountered: