Comments (31)
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
from faster-rcnn-tensorflow-python3.
i met the same problem.
did you solve it?
from faster-rcnn-tensorflow-python3.
@Jasonxu033 there is a problem in my dataset
from faster-rcnn-tensorflow-python3.
@tdf1995 what problem?
from faster-rcnn-tensorflow-python3.
I met the same problem. keep_inds = np.append(fg_inds, bg_inds) (Pdb), did you solve it?
from faster-rcnn-tensorflow-python3.
@niuniu111 Some probles in your dateset. There are some pictures couldnot fit the annotation.
from faster-rcnn-tensorflow-python3.
I use VGG16 to run normally. When running RESNET, there is a similar error. Does this mean that the data is OK?
from faster-rcnn-tensorflow-python3.
@niuniu111 sorry i didn't try resnet
from faster-rcnn-tensorflow-python3.
I changed the learning rate from 0.0001 to 0.1,then the (Pdb) error occurs, I hope it will help you
from faster-rcnn-tensorflow-python3.
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.
Just my observation. Hope it is helpful.
from faster-rcnn-tensorflow-python3.
It's hopeful,Thanks
from faster-rcnn-tensorflow-python3.
imdb.append_flipped_images() Will this code affect?
from faster-rcnn-tensorflow-python3.
f:\pycode\faster-rcnn-tensorflow-python3.5-master\lib\layer_utils\proposal_tar
get_layer.py(138)_sample_rois()
-> keep_inds = np.append(fg_inds, bg_inds)
(Pdb)
from faster-rcnn-tensorflow-python3.
Is training your own data set?
from faster-rcnn-tensorflow-python3.
You can try to reduce the value of SCALES.
from faster-rcnn-tensorflow-python3.
I tried it, is it modified in config.py? How much is it appropriate to change the value of SCALES?
from faster-rcnn-tensorflow-python3.
I use SCALES = [1,2,4,8,16], RATIOS = [0.5,1,2], you can try it.
from faster-rcnn-tensorflow-python3.
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
InvalidArgumentError (see above for traceback): Incompatible shapes: [0,24] vs.
[256,24]。
from faster-rcnn-tensorflow-python3.
Have you solved this problem later? I have encountered this problem again today.
from faster-rcnn-tensorflow-python3.
This problem appears after completing several rounds of training
same question,have you solved it??
from faster-rcnn-tensorflow-python3.
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
InvalidArgumentError (see above for traceback): Incompatible shapes: [0,24] vs.
[256,24]。
same question, have you solved this problem? What is the reason?
from faster-rcnn-tensorflow-python3.
Some probles in your dateset. There are some pictures couldnot fit the annotation.
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?
from faster-rcnn-tensorflow-python3.
Same question
from faster-rcnn-tensorflow-python3.
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
from faster-rcnn-tensorflow-python3.
if you are using pascal_voc.py to deal with your dataset, you can try to remove -1
from _load_pascal_annotation in those rows:
x1 = float(bbox.find('xmin').text) - 1
y1 = float(bbox.find('ymin').text) - 1
x2 = float(bbox.find('xmax').text) - 1
y2 = float(bbox.find('ymax').text) - 1
from faster-rcnn-tensorflow-python3.
when I use your approach, an exception is rainsing,which is proved image is wrong?@morpheusthewhite
from faster-rcnn-tensorflow-python3.
@niuniu111 yes, it is raised every time something in your dataset is not correct.
I met that problem when the annotation was associated to the wrong image; you should check it out
from faster-rcnn-tensorflow-python3.
that's mean your fg & bg all return 0..
step1:
u can print the fg & bg then u can find it in dataset
step2:
if the dataset is OK u probably change RPN to small anchor & ratio
step3:
u can e-Maill to me :[email protected]
from faster-rcnn-tensorflow-python3.
that's mean your fg & bg all return 0..
step1:
u can print the fg & bg then u can find it in dataset
step2:
if the dataset is OK u probably change RPN to small anchor & ratio
step3:
u can e-Maill to me :[email protected]
from faster-rcnn-tensorflow-python3.
i solve it.
First,find two lines in config.py:
tf.app.flags.DEFINE_float('roi_bg_threshold_high', 0.5, "Overlap threshold for a ROI to be considered background (class = 0 if overlap in [LO, HI))")
tf.app.flags.DEFINE_float('roi_bg_threshold_low', 0.1, "Overlap threshold for a ROI to be considered background (class = 0 if overlap in [LO, HI))")
Second,I modify two values :0.5 changed to 0.3 and 0.1 changed to 0.0.
I hope it can help you.
from faster-rcnn-tensorflow-python3.
@morpheusthewhite can you send your changes as PR?
from faster-rcnn-tensorflow-python3.
Related Issues (20)
- ResourceExhaustedError when allocating HOT 1
- 'NoneType' is not iterable: error during training HOT 9
- Unable to find vcvarsall.bat HOT 7
- TypeError: argument of type 'NoneType' is not iterable HOT 1
- AttributeError: 'NoneType' object has no attribute 'astype' HOT 1
- convert the ckpt model to pb model
- if v.name.split(':')[0] in var_keep_dic: TypeError: argument of type 'NoneType' is not iterable HOT 3
- InvalidArgumentError (see above for traceback): Incompatible shapes: [64,8] vs. [0,8]
- [Summary of the question]How to test the model after training? I can't find the .py to test the model.
- AttributeError: module 'lib' has no attribute 'datasets'
- Feature extracted network HOT 1
- How to draw the Recall-IoU curve?
- ModuleNotFoundError: No module named 'lib.utils.cython_bbox' HOT 4
- how to change the number of anchors? HOT 1
- KeError:Chair
- 怎么融合faster rcnn中第一层和第五层的特征作为第五层的输出?
- 请问怎样对视频目标进行检测?
- KeyError: 'image'
- AssertionError: Path does not exist: …………data/VOCdevkit2007/VOC2007/JPEGImages/showImages_(100).jpg
- [Summary of the question]How does the code need to be changed if cpu is used for training
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faster-rcnn-tensorflow-python3.