When reading darknet weights from file, allocate the vector capacity once, up front. Why not, may as well.
After watching some C++ Weekly videos and reading cppreference, it turns out type punning is bad and can cause undefined behaviour, sometimes, maybe, theoretically, possibly never. But, ..., probs a good idea to obey the C++ standard and do what is suggested, i.e. use memcpy()
memcpy()