일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- TFRecord
- 퍼셉트론
- 블록체인
- 유로화
- DataSet
- TensorFlow
- deeplearning
- Inference
- 비트코인
- 세계사
- Training
- numpy
- Perceptron
- opencv
- Python
- 딥러닝
- img
- cv2
- qtdesigner
- itksnap
- dtype
- keras
- 유가 급등
- 브렉시트
- terminal
- loss
- 세계대전
- pyqt
- error
- TF
Archives
- Today
- Total
활연개랑
[tensorflow] checking weights in checkpoint 본문
반응형
import tensorflow as tf
from tensorflow.python.training import py_checkpoint_reader
checkpoint_path = f'/cp-{123:0>4}.ckpt'
reader = py_checkpoint_reader.NewCheckpointReader(checkpoint_path)
dtype_map = reader.get_variable_to_dtype_map()
shape_map = reader.get_variable_to_shape_map()
state_dict = { v: reader.get_tensor(v) for v in shape_map}
with open('weight_check.txt', 'w') as file:
file.write(str(state_dict))