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

Problem I met when I try to train with ICDAR2017 dataset. #7

Closed
small-wong opened this issue May 3, 2018 · 5 comments
Closed

Problem I met when I try to train with ICDAR2017 dataset. #7

small-wong opened this issue May 3, 2018 · 5 comments

Comments

@small-wong
Copy link

When I try to train the model using ICDAR2017 dataset, I got the problem below. I wonder how can I fix this? I use the ICARD2015 converting scripts to convert the dataset, am I wrong here? Thanks! :)

INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, All bounding box coordinates must be in [0.0, 1.0]: -0.00061273575
[[Node: ssd_preprocessing_train/distorted_bounding_box_crop/SampleDistortedBoundingBox = SampleDistortedBoundingBox[T=DT_INT32, area_range=[0.1, 1], aspect_ratio_range=[0.5, 2], max_attempts=200, min_object_covered=0.1, seed=0, seed2=0, use_image_if_no_bounding_boxes=true, _device="/job:localhost/replica:0/task:0/cpu:0"](ssd_preprocessing_train/distorted_bounding_box_crop/Shape_1, ssd_preprocessing_train/distorted_bounding_box_crop/ExpandDims)]]

Caused by op u'ssd_preprocessing_train/distorted_bounding_box_crop/SampleDistortedBoundingBox', defined at:
File "train_pixel_link.py", line 293, in
tf.app.run()
File "/data/app/smallhuang/anaconda2/envs/pixel_link/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train_pixel_link.py", line 287, in main
batch_queue = create_dataset_batch_queue(dataset)
File "train_pixel_link.py", line 136, in create_dataset_batch_queue
is_training = True)
File "/data/app/smallhuang/pixel_link/preprocessing/ssd_vgg_preprocessing.py", line 480, in preprocess_image
data_format=data_format)
File "/data/app/smallhuang/pixel_link/preprocessing/ssd_vgg_preprocessing.py", line 380, in preprocess_for_train
area_range = AREA_RANGE)
File "/data/app/smallhuang/pixel_link/preprocessing/ssd_vgg_preprocessing.py", line 246, in distorted_bounding_box_crop
use_image_if_no_bounding_boxes=True)
File "/data/app/smallhuang/anaconda2/envs/pixel_link/lib/python2.7/site-packages/tensorflow/python/ops/gen_image_ops.py", line 989, in sample_distorted_bounding_box
name=name)
File "/data/app/smallhuang/anaconda2/envs/pixel_link/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/data/app/smallhuang/anaconda2/envs/pixel_link/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/data/app/smallhuang/anaconda2/envs/pixel_link/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1228, in init
self._traceback = _extract_stack()

@dengdan
Copy link
Member

dengdan commented May 3, 2018

All bounding box coordinates must be in [0.0, 1.0]: -0.00061273575
This error message tells everything. You should modify the lines in icdar2015_to_tfrecords to make all the bbox values be within the valid range, i.e., [0, 1]:

def to_valid_range(v):
  if v < 0:
    return 0
  if v > 1:
    return 1
  return v

xmin = to_valid_range(xs.min())
xmax = to_valid_range(xs.max())
ymin = to_valid_range(ys.min())
ymax = to_valid_range(ys.max())

The above code has not been tested, only for explanation.

@dengdan dengdan closed this as completed May 3, 2018
@small-wong
Copy link
Author

Thank you very much!~

@alpace
Copy link

alpace commented Mar 18, 2019

@small-wong can you provide the icdar2017 dataset ?

@small-wong
Copy link
Author

@alpace Sorry, I have not worked on this project for a long time and I did not save the dataset. May be you can search that on Google. Good luck for you~

@v-smwang
Copy link

+1

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

4 participants