Giter Club home page Giter Club logo

fots's Introduction

FOTS: Fast Oriented Text Spotting with a Unified Network

Introduction

Do text detect and OCR in an entire End-to-End model

All detect and OCR modules have been tested!

Installation

  • tensorflow
  • opencv

Train

python2 multigpu_train.py [gpu_list]

You should give the path to the dataset labeled in ICDAR format in file 'FOTS/dataset/dataReader.py'

Test

call FOTS_testModel()

Author

Call me [email protected]

From @SF.Tech

fots's People

Contributors

yu20103983 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fots's Issues

performance

thanks for your good work~
I have two question, we need to download ICDAR dataset to train the model,than we should finetune it on our scences?
now,the recognition branch is completed?

Labels length is zero

thank for your good work~
when I train the model on MLT dataset,I got the error. can you tell me how can i handle it?
thanks

InvalidArgumentError (see above for traceback): Labels length is zero in batch 26
[[Node: model_2/CTCLoss = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=true, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](model_2/lstmLayers/fc/BiasAdd/_19615, _arg_model_2/input_btags/indices_0_32, _arg_model_2/input_btags/values_0_34, model_2/Cast/_19617)]]
[[Node: model_2/CTCLoss/_19621 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_49165_model_2/CTCLoss", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]]

NotFoundError: dataFolder/FOST_textOnPlate

你好:
我已经在FOTS/dataset/dataReader.py中配置了ICDAR2015 4.4_end_to_end的训练数据:
error_nosuchdir
但是运行python multigpu_train.py 0训练,还是会报错:
Traceback (most recent call last): File "multigpu_train.py", line 221, in <module> tf.app.run() File "/home/gust01/.conda/envs/tensorflow_py2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "multigpu_train.py", line 93, in main tf.gfile.MkDir(FLAGS.checkpoint_path) File "/home/gust01/.conda/envs/tensorflow_py2/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 409, in create_dir create_dir_v2(dirname) File "/home/gust01/.conda/envs/tensorflow_py2/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 427, in create_dir_v2 pywrap_tensorflow.CreateDir(compat.as_bytes(path), status) File "/home/gust01/.conda/envs/tensorflow_py2/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in __exit__ c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.NotFoundError: dataFolder/FOST_textOnPlate; No such file or directory
请问这个dataFolder/FOST_textOnPlate目录是在哪里配置的呢,该怎么解决呢?
谢谢你的查看!

Have you test accuracy?

Have you tested the accuracy of the rewriting code?
Does it perform as well as described in the paper?

too long time to wait

the code running enqueuer = GeneratorEnqueuer(generator(**kwargs), use_multiprocessing=True) print('Generator use 10 batches for buffering, this may take a while, you can tune this yourself.') enqueuer.start(max_queue_size=10, workers=num_workers)

8 cpu all go up, keep running for several hours, but gpu usage is 0, and seems not starting training.

InvalidArgumentError (see above for traceback): assertion failed: [width must be >= target + offset.]

Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [width must be >= target + offset.]
[[{{node scan/while/crop_to_bounding_box/Assert_4/Assert}}]]
[[{{node scan/while/Cast_1}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "multigpu_train.py", line 223, in
tf.app.run()
File "/usr/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "multigpu_train.py", line 218, in main
test_output = fots_testModel.detectRecg(d_images, sess=sess)
File "/home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/fots_testModel.py", line 233, in detectRecg
rois, ws = self.sess.run([rois_op, ws_op])
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [width must be >= target + offset.]
[[node scan/while/crop_to_bounding_box/Assert_4/Assert (defined at /home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py:19) ]]
[[node scan/while/Cast_1 (defined at /home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py:25) ]]

Caused by op 'scan/while/crop_to_bounding_box/Assert_4/Assert', defined at:
File "multigpu_train.py", line 223, in
tf.app.run()
File "/usr/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "multigpu_train.py", line 218, in main
test_output = fots_testModel.detectRecg(d_images, sess=sess)
File "/home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/fots_testModel.py", line 231, in detectRecg
rois_op, ws_op = RoiRotate.RoiRotate(filter_bsharedFeatures, FLAGS.features_stride)(brotateParas)
File "/home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py", line 65, in call
textImgFeatures = tf.scan(self.scanFunc, [ifeatures_tile, outBoxes, cropBoxes, angles], [np.zeros((self.fix_RoiHeight, self.max_RoiWidth, channels), np.float32), np.array(0, np.int32)])
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/functional_ops.py", line 724, in scan
maximum_iterations=n)
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3556, in while_loop
return_same_structure)
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3087, in BuildLoop
pred, body, original_loop_vars, loop_vars, shape_invariants)
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3022, in _BuildLoop
body_result = body(*packed_vars_for_body)
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3525, in
body = lambda i, lv: (i + 1, orig_body(*lv))
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/functional_ops.py", line 703, in compute
a_out = fn(packed_a, packed_elems)
File "/home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py", line 19, in scanFunc
cropFeatures = tf.image.crop_to_bounding_box(ifeatures, outBox[1], outBox[0], outBox[3], outBox[2])
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/image_ops_impl.py", line 802, in crop_to_bounding_box
'width must be >= target + offset.')
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/image_ops_impl.py", line 80, in _assert
return [control_flow_ops.Assert(cond, [msg])]
File "/usr/lib/python3.7/site-packages/tensorflow/python/util/tf_should_use.py", line 193, in wrapped
return _add_should_use_warning(fn(*args, **kwargs))
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 160, in Assert
return gen_logging_ops._assert(condition, data, summarize, name="Assert")
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 72, in _assert
name=name)
File "/usr/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/usr/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/usr/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1801, in init
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): assertion failed: [width must be >= target + offset.]
[[node scan/while/crop_to_bounding_box/Assert_4/Assert (defined at /home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py:19) ]]
[[node scan/while/Cast_1 (defined at /home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py:25) ]]

Saw non-null label

Running command: python multi_gputrain.py
Error: Saw non-null label

I've fixed this error by change self.NUM_CLASSES into self.NUM_CLASSES+1 in recognizer.py, because CTC loss in tensorflow need number of class plus 1 to work with:

self.logits = slim.fully_connected(lstmout, self.NUM_CLASSES+1, activation_fn=None, scope='fc')

This action help to pass the bug.
I'm on my work to check its right for training.

ValueError: not enough values to unpack (expected 3, got 1)

Hi @yu20103983 ,
I've faced with this issue, Can you help to fix this?

 File "/home/FOTS/multigpu_train.py", line 230, in main
    fots_testModel.detectRecg(d_images, sess=sess)
  File "/home/FOTS/FOTS/fots_testModel.py", line 257, in detectRecg
    rois_op, ws_op = RoiRotate.RoiRotate(filter_bsharedFeatures, FLAGS.features_stride)(brotateParas)
  File "/home/FOTS/FOTS/RoiRotate.py", line 50, in __call__
    outBoxes, cropBoxes, angles = rboxes
ValueError: not enough values to unpack (expected 3, got 1)

Thanks a lot ^^!

InvalidArgumentError (see above for traceback): assertion failed: [width must be >= target + offset.]

Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [width must be >= target + offset.]
[[{{node scan/while/crop_to_bounding_box/Assert_4/Assert}}]]
[[{{node scan/while/Cast_1}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "multigpu_train.py", line 223, in
tf.app.run()
File "/usr/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "multigpu_train.py", line 218, in main
test_output = fots_testModel.detectRecg(d_images, sess=sess)
File "/home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/fots_testModel.py", line 233, in detectRecg
rois, ws = self.sess.run([rois_op, ws_op])
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/usr/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [width must be >= target + offset.]
[[node scan/while/crop_to_bounding_box/Assert_4/Assert (defined at /home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py:19) ]]
[[node scan/while/Cast_1 (defined at /home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py:25) ]]

Caused by op 'scan/while/crop_to_bounding_box/Assert_4/Assert', defined at:
File "multigpu_train.py", line 223, in
tf.app.run()
File "/usr/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "multigpu_train.py", line 218, in main
test_output = fots_testModel.detectRecg(d_images, sess=sess)
File "/home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/fots_testModel.py", line 231, in detectRecg
rois_op, ws_op = RoiRotate.RoiRotate(filter_bsharedFeatures, FLAGS.features_stride)(brotateParas)
File "/home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py", line 65, in call
textImgFeatures = tf.scan(self.scanFunc, [ifeatures_tile, outBoxes, cropBoxes, angles], [np.zeros((self.fix_RoiHeight, self.max_RoiWidth, channels), np.float32), np.array(0, np.int32)])
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/functional_ops.py", line 724, in scan
maximum_iterations=n)
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3556, in while_loop
return_same_structure)
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3087, in BuildLoop
pred, body, original_loop_vars, loop_vars, shape_invariants)
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3022, in _BuildLoop
body_result = body(*packed_vars_for_body)
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3525, in
body = lambda i, lv: (i + 1, orig_body(*lv))
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/functional_ops.py", line 703, in compute
a_out = fn(packed_a, packed_elems)
File "/home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py", line 19, in scanFunc
cropFeatures = tf.image.crop_to_bounding_box(ifeatures, outBox[1], outBox[0], outBox[3], outBox[2])
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/image_ops_impl.py", line 802, in crop_to_bounding_box
'width must be >= target + offset.')
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/image_ops_impl.py", line 80, in _assert
return [control_flow_ops.Assert(cond, [msg])]
File "/usr/lib/python3.7/site-packages/tensorflow/python/util/tf_should_use.py", line 193, in wrapped
return _add_should_use_warning(fn(*args, **kwargs))
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/control_flow_ops.py", line 160, in Assert
return gen_logging_ops._assert(condition, data, summarize, name="Assert")
File "/usr/lib/python3.7/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 72, in _assert
name=name)
File "/usr/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/usr/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
op_def=op_def)
File "/usr/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1801, in init
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): assertion failed: [width must be >= target + offset.]
[[node scan/while/crop_to_bounding_box/Assert_4/Assert (defined at /home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py:19) ]]
[[node scan/while/Cast_1 (defined at /home/prir1005/.PRIRMSERdata/prir1005/LM/FOTS-master/FOTS/RoiRotate.py:25) ]]

TypeError when multigpu train

Traceback (most recent call last):
File "multigpu_train.py", line 221, in
tf.app.run()
File "/data/home/zjw/anaconda3/envs/tf-py27/lib/python2.7/site-packages/tensorflow/python/pla
tform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "multigpu_train.py", line 113, in main
models.append(build_model(opt, reuse_variables, scope))
File "multigpu_train.py", line 76, in build_model
fots = FOTS_trainModel(input_images, input_brboxes, reuse_variables)
File "/data/home/zjw/pythonFile/FOTS-1/FOTS/fots_trainModel.py", line 22, in init
self.rg = recognizer.recognizer(self.rois, self.ws, NUM_CLASSES, FLAGS.keepProb, is_trainin
g=True)
File "/data/home/zjw/pythonFile/FOTS-1/FOTS/recognizer.py", line 19, in init
self.convLayers(weight_decay, is_training)
File "/data/home/zjw/pythonFile/FOTS-1/FOTS/recognizer.py", line 63, in convLayers
self.word_vec = tf.transpose(tf.reshape(x, (-1, x.shape[2], x.shape[3])), (1, 0, 2))
File "/data/home/zjw/anaconda3/envs/tf-py27/lib/python2.7/site-packages/tensorflow/python/op
/gen_array_ops.py", line 2619, in reshape
name=name)
File "/data/home/zjw/anaconda3/envs/tf-py27/lib/python2.7/site-packages/tensorflow/python/fra
mework/op_def_library.py", line 493, in apply_op
raise err
TypeError: Failed to convert object of type <type 'tuple'> to Tensor. Contents: (-1, Dimension(
64), Dimension(128)). Consider casting elements to a supported type.

=============================================================
The problem occurs when I train in ICDAR2015, can anyone help to fix it?
Thanks a lot.

How to process those RoIs with larger width (e.g., >256)?

Hi, thanks a lot for sharing your great work on FOTS.
I have a question, in the code, you set the maximum width of RoIs is 256, but in practices, is this OK for those RoIs with larger width? If convenient, could you please give some advice on how to process these ROIs in recognition branch? Thanks.

ValueError: Tensor conversion requested dtype float32 for Tensor with dtype float64

Running command: python multi_gputrain.py
Error:

Traceback (most recent call last):
  File "multigpu_train.py", line 234, in <module>
    tf.app.run()
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "multigpu_train.py", line 230, in main
    fots_testModel.detectRecg(d_images, sess=sess)
  File "/home/ocr/FOTS/FOTS/fots_testModel.py", line 262, in detectRecg
    rois_op, ws_op = RoiRotate.RoiRotate(filter_bsharedFeatures, FLAGS.features_stride)(brotateParas)
  File "/home/ocr/FOTS/FOTS/RoiRotate.py", line 73, in __call__
    np.array(0, np.int32)])
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/ops/functional_ops.py", line 683, in scan
    maximum_iterations=n)
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3209, in while_loop
    result = loop_context.BuildLoop(cond, body, loop_vars, shape_invariants)
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2941, in BuildLoop
    pred, body, original_loop_vars, loop_vars, shape_invariants)
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 2878, in _BuildLoop
    body_result = body(*packed_vars_for_body)
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/ops/control_flow_ops.py", line 3179, in <lambda> 
    body = lambda i, lv: (i + 1, orig_body(*lv))
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/ops/functional_ops.py", line 662, in compute
    a_out = fn(packed_a, packed_elems)
  File "/home/ocr/FOTS/FOTS/RoiRotate.py", line 21, in scanFunc
    rotateCropedFeatures = tf.contrib.image.rotate(cropFeatures, angle)
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/contrib/image/python/ops/image_ops.py", line 83, in rotate
    angles_to_projective_transforms(angles, image_height, image_width),
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/contrib/image/python/ops/image_ops.py", line 142, in angles_to_projective_transforms
    angles, name="angles", dtype=dtypes.float32)
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1011, in convert_to_tensor
    as_ref=False)
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1107, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/home/ocr/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 944, in _TensorTensorConversionFunction
    (dtype.name, t.dtype.name, str(t)))
ValueError: Tensor conversion requested dtype float32 for Tensor with dtype float64: 'Tensor("scan/while/TensorArrayReadV3_3:0", shape=(), dtype=float64)'

TypeError: 'float' object cannot be interpreted as an integer

Error:

Traceback (most recent call last):
  File "/home/kei/FOTS/multigpu_train.py", line 234, in <module>
    tf.app.run()
  File "/home/kei/miniconda3/envs/tf3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "/home/kei/FOTS/multigpu_train.py", line 121, in main
    models.append(build_model(opt, reuse_variables, scope))
  File "/home/kei/FOTS/multigpu_train.py", line 81, in build_model
    fots = FOTS_trainModel(input_images, input_brboxes, reuse_variables)
  File "/home/kei/FOTS/FOTS/fots_trainModel.py", line 25, in __init__
    self.rois, self.ws = RoiRotate.RoiRotate(self.sharedFeatures, FLAGS.features_stride)(brboxes)
  File "/home/kei/FOTS/FOTS/RoiRotate.py", line 68, in __call__
    [np.zeros((self.fix_RoiHeight, self.max_RoiWidth, channels), np.float32),
TypeError: 'float' object cannot be interpreted as an integer

IndexError: too many indices for array

Hi @yu20103983 , I run detectRecg in fots_testModel.py and faced with this error:

 File "/home/FOTS/multigpu_train.py", line 230, in main
    fots_testModel.detectRecg(d_images, sess=sess)
  File "/home/FOTS/FOTS/fots_testModel.py", line 222, in detectRecg
    para = restore_roiRotatePara(rbox)
  File "/home/FOTS/FOTS/dataset/dataReader.py", line 561, in restore_roiRotatePara
    rectange, rotate_angle = sort_rectangle(box)
  File "/home/FOTS/FOTS/dataset/dataReader.py", line 405, in sort_rectangle
    p_lowest = np.argmax(poly[:, 1])
IndexError: too many indices for array

It seems to have some problem with value-dimension, then it cannot use np.argmax(poly[:, 1])

Can you have any way to fix this? thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.