-
estemator.predict的方式需要多次重新加载模型,发现难以实现高效部署。
参考https://blog.csdn.net/hezhefly/article/details/98877796?utm_term=Estimatortensorflow%E5%8A%A0%E8%BD%BD%E6%A8%A1%E5%9E%8B&utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~all~sobaiduweb~default-1-98877796&spm=3001.4430
依旧没有实现
-
加载训练的ckpt模型,使用传入feed_dict的方式,但是发现模型中没有输入的变量,tensor_name_list如下:
<class 'list'>: ['global_step/Initializer/zeros', 'global_step', 'global_step/Assign', 'global_step/read', 'global_step/IsVariableInitialized', 'global_step/cond/Switch', 'global_step/cond/switch_t', 'global_step/cond/switch_f', 'global_step/cond/pred_id', 'global_step/cond/read/Switch', 'global_step/cond/read', 'global_step/cond/Switch_1', 'global_step/cond/Merge', 'global_step/add/y', 'global_step/add', 'Const', 'flat_filenames/shape', 'flat_filenames', 'TensorSliceDataset', 'FlatMapDataset', 'count', 'RepeatDataset', 'buffer_size', 'seed', 'seed2', 'ShuffleDataset', 'batch_size', 'num_parallel_calls', 'drop_remainder', 'ExperimentalMapAndBatchDataset', 'optimizations', 'OptimizeDataset', 'ModelDataset', 'IteratorV2', 'MakeIterator', 'IteratorToStringHandle', 'IteratorGetNext', 'Shape', 'strided_slice/stack', 'strided_slice/stack_1', 'strided_slice/stack_2', 'strided_slice', 'bert/embeddings/ExpandDims/dim', 'bert/embeddings/ExpandDims', 'bert/embeddings/word_embeddings/Initializer/truncated_normal/shape', 'bert/embeddings/word_embeddings/Initializer/truncated_normal/mean', 'bert/embeddings/word_embeddings/Initializer/truncated_normal/stddev', 'bert/embeddings/word_embeddings/Initializer/truncated_normal/TruncatedNormal', 'bert/embeddings/word_embeddings/Initializer/truncated_normal/mul', 'bert/embeddings/word_embeddings/Initializer/truncated_normal', 'bert/embeddings/word_embeddings', 'bert/embeddings/word_embeddings/Assign', 'bert/embeddings/word_embeddings/read', 'bert/embeddings/Reshape/shape', 'bert/embeddings/Reshape', 'bert/embeddings/GatherV2/axis', 'bert/embeddings/GatherV2', 'bert/embeddings/Shape', 'bert/embeddings/strided_slice/stack', 'bert/embeddings/strided_slice/stack_1', 'bert/embeddings/strided_slice/stack_2', 'bert/embeddings/strided_slice', 'bert/embeddings/Reshape_1/shape/1', 'bert/embeddings/Reshape_1/shape/2', 'bert/embeddings/Reshape_1/shape', 'bert/embeddings/Reshape_1', 'bert/embeddings/Shape_1', 'bert/embeddings/strided_slice_1/stack', 'bert/embeddings/strided_slice_1/stack_1', 'bert/embeddings/strided_slice_1/stack_2', 'bert/embeddings/strided_slice_1', 'bert/embeddings/token_type_embeddings/Initializer/truncated_normal/shape', 'bert/embeddings/token_type_embeddings/Initializer/truncated_normal/mean', 'bert/embeddings/token_type_embeddings/Initializer/truncated_normal/stddev', 'bert/embeddings/token_type_embeddings/Initializer/truncated_normal/TruncatedNormal', 'bert/embeddings/token_type_embeddings/Initializer/truncated_normal/mul', 'bert/embeddings/token_type_embeddings/Initializer/truncated_normal', 'bert/embeddings/token_type_embeddings', 'bert/embeddings/token_type_embeddings/Assign', 'bert/embeddings/token_type_embeddings/read', 'bert/embeddings/Reshape_2/shape', 'bert/embeddings/Reshape_2', 'bert/embeddings/one_hot/on_value', 'bert/embeddings/one_hot/off_value', 'bert/embeddings/one_hot/depth', 'bert/embeddings/one_hot', 'bert/embeddings/MatMul', 'bert/embeddings/Reshape_3/shape/1', 'bert/embeddings/Reshape_3/shape/2', 'bert/embeddings/Reshape_3/shape', 'bert/embeddings/Reshape_3', 'bert/embeddings/add', 'bert/embeddings/assert_less_equal/x', 'bert/embeddings/assert_less_equal/y', 'bert/embeddings/assert_less_equal/LessEqual', 'bert/embeddings/assert_less_equal/Const', 'bert/embeddings/assert_less_equal/All', 'bert/embeddings/assert_less_equal/Assert/Const', 'bert/embeddings/assert_less_equal/Assert/Const_1', 'bert/embeddings/assert_less_equal/Assert/Const_2'...