rodrigo2019 / keras_yolo2

MIT License
46 stars 15 forks source link

custom dataset #10

Closed vcvishal closed 5 years ago

vcvishal commented 5 years ago

thank you for good code

when i used my dataset, training was ok in prediction this error occurred

C:\Users\vcvis\Desktop\yolo experiment\keras_yolo2-master>python predict.py -c config.json -w ./Tiny_yolo_VOC_20190603173100_bestLoss.h5 -i ./8A0024.png Using TensorFlow backend. 2019-06-03 17:37:08.479825: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2019-06-03 17:37:09.440811: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1356] Found device 0 with properties: name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.62 pciBusID: 0000:01:00.0 totalMemory: 4.00GiB freeMemory: 3.30GiB 2019-06-03 17:37:09.448444: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1435] Adding visible gpu devices: 0 2019-06-03 17:37:10.017990: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-06-03 17:37:10.022970: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:929] 0 2019-06-03 17:37:10.026223: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:942] 0: N 2019-06-03 17:37:10.030465: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3030 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1) Loading pretrained weights: ./backend_weights/tiny_yolo_backend.h5 (13, 13)


Layer (type) Output Shape Param #

input_1 (InputLayer) (None, 416, 416, 3) 0


Tiny_YOLO_backend (Model) (None, 13, 13, 1024) 15739760


Detection_layer (Conv2D) (None, 13, 13, 25) 25625


YOLO_output (Reshape) (None, 13, 13, 5, 5) 0

Total params: 15,765,385 Trainable params: 15,759,273 Non-trainable params: 6,112


Traceback (most recent call last): File "predict.py", line 145, in main(_args) File "predict.py", line 74, in main yolo.load_weights(weights_path) File "C:\Users\vcvis\Desktop\yolo experiment\keras_yolo2-master\keras_yolov2\frontend.py", line 77, in load_weights self._model.load_weights(weight_path) File "C:\Users\vcvis\AppData\Roaming\Python\Python36\site-packages\keras\engine\network.py", line 1166, in load_weights f, self.layers, reshape=reshape) File "C:\Users\vcvis\AppData\Roaming\Python\Python36\site-packages\keras\engine\saving.py", line 1058, in load_weights_from_hdf5_group K.batch_set_value(weight_value_tuples) File "C:\Users\vcvis\AppData\Roaming\Python\Python36\site-packages\keras\backend\tensorflow_backend.py", line 2470, in batch_set_value get_session().run(assign_ops, feed_dict=feed_dict) File "D:\miniconda\lib\site-packages\tensorflow\python\client\session.py", line 900, in run run_metadata_ptr) File "D:\miniconda\lib\site-packages\tensorflow\python\client\session.py", line 1111, in _run str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (30, 1024, 1, 1) for Tensor 'Placeholder_40:0', which has shape '(1, 1, 1024, 25)'

please guide thank you

rodrigo2019 commented 5 years ago

in the config json files, into labels properties put [""]

vcvishal commented 5 years ago

thank you, it worked