yu20103983 / FOTS

FOTS tensorflow implementation, Include train and test, EAST+Rotate+CRNN. FOTS: Fast Oriented Text Spotting with a Unified Network
89 stars 35 forks source link

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

Closed kei6 closed 5 years ago

kei6 commented 5 years ago

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
kei6 commented 5 years ago

Fix by change:

        self.max_RoiWidth = FLAGS.virtule_MaxRoiWidth / features_stride
        self.fix_RoiHeight = FLAGS.virtule_RoiHeight / features_stride

into:

        self.max_RoiWidth = FLAGS.virtule_MaxRoiWidth // features_stride
        self.fix_RoiHeight = FLAGS.virtule_RoiHeight // features_stride

in RoiRotate.py

Then, I'll close this issue.