YAD2K icon indicating copy to clipboard operation
YAD2K copied to clipboard

Getting error TypeError: buffer is too small for requested array with Memory Warning, while converting into H5

Open vasanthhr opened this issue 4 years ago • 1 comments

Hello ALL,

I tried to convert this weights and cfg files. And Even I tried to use new cfg files as mentioned in https://github.com/pjreddie/darknet/tree/master/cfg . But no success and still getting the same error as mentioned below.

Used the below command for conversion:

./yad2k.py face_config.cfg tiny-yolo-azface-fddb_82000.weights model_data/f-y2-t.h5

Getting below error:

Parsing section convolutional_4
conv2d bn leaky (3, 3, 128, 256)
Parsing section maxpool_4
Parsing section convolutional_5
conv2d bn leaky (3, 3, 256, 512)
Parsing section maxpool_5
Parsing section convolutional_6
conv2d bn leaky (3, 3, 512, 1024)
2019-07-14 15:00:28.017644: W tensorflow/core/framework/allocator.cc:107] Allocation of 18874368 exceeds 10% of system memory.
2019-07-14 15:00:28.271043: W tensorflow/core/framework/allocator.cc:107] Allocation of 18874368 exceeds 10% of system memory.
2019-07-14 15:00:28.305239: W tensorflow/core/framework/allocator.cc:107] Allocation of 18874368 exceeds 10% of system memory.
Parsing section convolutional_7
conv2d bn leaky (3, 3, 1024, 1024)
2019-07-14 15:00:29.538725: W tensorflow/core/framework/allocator.cc:107] Allocation of 37748736 exceeds 10% of system memory.
2019-07-14 15:00:30.050551: W tensorflow/core/framework/allocator.cc:107] Allocation of 37748736 exceeds 10% of system memory.
Parsing section convolutional_8
conv2d    linear (1, 1, 1024, 30)
Traceback (most recent call last):
  File "./yad2k.py", line 270, in <module>
    _main(parser.parse_args())
  File "./yad2k.py", line 156, in _main
    buffer=weights_file.read(weights_size * 4))
TypeError: buffer is too small for requested array

Originally posted by @vasanthhr in https://github.com/allanzelener/YAD2K/issues/9#issuecomment-511229183

vasanthhr avatar Jul 14 '19 19:07 vasanthhr

I've just met the same problem, when i using weighs from http://pjreddie.com/media/files/yolo.weights and cfg from https://github.com/pjreddie/darknet/blob/master/cfg/yolov2.cfg. But when I using weights and cfg from the same model in https://pjreddie.com/darknet/yolo/ ,it works well. So I guess you may also use two different model's cfg and weights.

zui-jiang avatar Jul 25 '19 08:07 zui-jiang