Hi, guys:
It's really hard to understand these codes below, I mean , if we can't see .weights, how can I parse hyper-parameters from .weights? by the way, what is major? minor? revision? and why read(12)?
major, minor, revision = np.ndarray(shape=(3, ), dtype='int32', buffer=weights_file.read(12))
if (major*10+minor)>=2 and major<1000 and minor<1000:
seen = np.ndarray(shape=(1,), dtype='int64', buffer=weights_file.read(8))
else:
seen = np.ndarray(shape=(1,), dtype='int32', buffer=weights_file.read(4))
print('Weights Header: ', major, minor, revision, seen)
Hi, guys: It's really hard to understand these codes below, I mean , if we can't see .weights, how can I parse hyper-parameters from .weights? by the way, what is major? minor? revision? and why read(12)? major, minor, revision = np.ndarray(shape=(3, ), dtype='int32', buffer=weights_file.read(12)) if (major*10+minor)>=2 and major<1000 and minor<1000: seen = np.ndarray(shape=(1,), dtype='int64', buffer=weights_file.read(8)) else: seen = np.ndarray(shape=(1,), dtype='int32', buffer=weights_file.read(4)) print('Weights Header: ', major, minor, revision, seen)
Thanks a lot!