mvoelk/ssd_detectors

[Question] How gt_util_synthtext_seglink.pkl is generated?

Closed this issue · 7 comments

Hi,

I am trying to experiment with tbpp training program. However, I am a little confused about gt_util_synthtext_seglink.pkl file. How exactly should I generate the file?

I have tried running data_synthtext.py, which generates gt_util_synthtext.pkl. I then simply rename it to gt_util_synthtext_seglink.pkl. However, with this file, when running tbpp training program, I receive exceptions. I am attaching the detailed message below, but I think the problem happens at:

File "Z:\Users\jie\projects\ssd_detectors\tbpp_utils.py", line 21, in
gt_rboxes = np.array([polygon_to_rbox3(np.reshape(p, (-1,2))) for p in gt_data[:,:8]])

p is of size 5, of course, won't be able to reshape to (2).

I suspect that it is because the pickle file is not in the expected format. Could anyone explain to me how exactly the pickle file is generated. Many thanks indeed.

Best Regards
Jie

C:\Python36\python.exe Z:/Users/jie/projects/ssd_detectors/txbb_train.py
Using TensorFlow backend.
layer missing input_2
2018-08-25 09:26:20.701900: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2018-08-25 09:26:21.011315: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1404] Found device 0 with properties:
name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.683
pciBusID: 0000:01:00.0
totalMemory: 11.00GiB freeMemory: 9.10GiB
2018-08-25 09:26:21.011663: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1483] Adding visible gpu devices: 0
2018-08-25 09:26:21.703413: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:964] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-08-25 09:26:21.703617: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:970] 0
2018-08-25 09:26:21.703747: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:983] 0: N
2018-08-25 09:26:21.703968: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1096] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 8795 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
2018-08-25 09:26:21.704888: E T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:228] Illegal GPUOptions.experimental.num_dev_to_dev_copy_streams=0 set to 1 instead.
layer missing zero_padding2d_2
something went wrong conv4_3_norm_mbox_conf
model [[3, 5, 512, 28], [28]]
file [(3, 3, 512, 84), (84,)]
Layer weight shape (3, 5, 512, 28) not compatible with provided weight shape (3, 3, 512, 84)
layer missing fc7_mbox_conf
layer missing conv6_2_mbox_conf
layer missing conv7_2_mbox_conf
layer missing conv8_2_mbox_conf
layer missing conv9_2_mbox_conf
layer missing conv10_2_mbox_conf
something went wrong conv4_3_norm_mbox_loc
model [[3, 5, 512, 56], [56]]
file [(3, 3, 512, 16), (16,)]
Layer weight shape (3, 5, 512, 56) not compatible with provided weight shape (3, 3, 512, 16)
layer missing fc7_mbox_loc
layer missing conv6_2_mbox_loc
layer missing conv7_2_mbox_loc
layer missing conv8_2_mbox_loc
layer missing conv9_2_mbox_loc
layer missing conv10_2_mbox_loc
layer missing fc7_mbox_conf_flat
layer missing conv6_2_mbox_conf_flat
layer missing conv7_2_mbox_conf_flat
layer missing conv8_2_mbox_conf_flat
layer missing conv9_2_mbox_conf_flat
layer missing conv10_2_mbox_conf_flat
layer missing fc7_mbox_loc_flat
layer missing conv6_2_mbox_loc_flat
layer missing conv7_2_mbox_loc_flat
layer missing conv8_2_mbox_loc_flat
layer missing conv9_2_mbox_loc_flat
layer missing conv10_2_mbox_loc_flat
layer missing conv4_3_norm_mbox_priorbox
layer missing fc7_mbox_priorbox
layer missing conv6_2_mbox_priorbox
layer missing conv7_2_mbox_priorbox
layer missing conv8_2_mbox_priorbox
layer missing conv9_2_mbox_priorbox
layer missing conv10_2_mbox_priorbox
layer missing mbox_priorbox
Epoch 1/100
Traceback (most recent call last):
File "Z:/Users/jie/projects/ssd_detectors/txbb_train.py", line 89, in
initial_epoch=initial_epoch,
File "C:\Python36\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "C:\Python36\lib\site-packages\keras\engine\training.py", line 1426, in fit_generator
initial_epoch=initial_epoch)
File "C:\Python36\lib\site-packages\keras\engine\training_generator.py", line 155, in fit_generator
generator_output = next(output_generator)
File "C:\Python36\lib\site-packages\keras\utils\data_utils.py", line 793, in get
six.reraise(value.class, value, value.traceback)
File "C:\Python36\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Python36\lib\site-packages\keras\utils\data_utils.py", line 658, in _data_generator_task
generator_output = next(self._generator)
File "Z:\Users\jie\projects\ssd_detectors\ssd_data.py", line 530, in generate
y = self.prior_util.encode(y)
File "Z:\Users\jie\projects\ssd_detectors\tbpp_utils.py", line 21, in encode
gt_rboxes = np.array([polygon_to_rbox3(np.reshape(p, (-1,2))) for p in gt_data[:,:8]])
File "Z:\Users\jie\projects\ssd_detectors\tbpp_utils.py", line 21, in
gt_rboxes = np.array([polygon_to_rbox3(np.reshape(p, (-1,2))) for p in gt_data[:,:8]])
File "C:\Python36\lib\site-packages\numpy\core\fromnumeric.py", line 279, in reshape
return _wrapfunc(a, 'reshape', newshape, order=order)
File "C:\Python36\lib\site-packages\numpy\core\fromnumeric.py", line 51, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
ValueError: cannot reshape array of size 5 into shape (2)

Process finished with exit code 1

Sorry, I just noticed that I should set polygon=True. Now, the training program starts running.

Why is polygon set to False by default if the training code will fail? I just ran into this problem because I'm attempting to train the model on a custom dataset.

@seangtkelley SSD and TextBoxes work with axis aligned bounding boxes (polygon=False), but SegLink and TextBoxes++ work with oriented bounding boxes and require a different representation (polygon=True). It is probably not the most elegant solution and it may depend on your interpretation of 'default'... An alternative could be to write a separate class for the polygon case.

I run data_synthtext.py script and the error I got is:
TypeError: 'NoneType' object is not iterable
Do you meet this error and do you know how to fix?

Have you placed the SynthText dataset at the right location? For instance ./data/SynthText/gt.mat ...

@mvoelk Ohh I could not find the place to get SyntText dataset which is gt.mat or do I need to run another script to create that file? (If yes, what script plz?)

I made it, thanks