일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
29 | 30 | 31 |
Tags
- DataSet
- 브렉시트
- TF
- cv2
- numpy
- terminal
- 세계사
- 세계대전
- error
- 딥러닝
- 블록체인
- 퍼셉트론
- img
- loss
- dtype
- pyqt
- 유로화
- TFRecord
- 유가 급등
- Inference
- Perceptron
- TensorFlow
- deeplearning
- qtdesigner
- 비트코인
- opencv
- Training
- itksnap
- keras
- Python
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))