White Papers
18 CheXNet – Inference with Nvidia T4 on Dell EMC PowerEdge R7425 | Document ID
graph = tf.Graph()
with tf.Session(graph=graph) as sess:
tf.saved_model.loader.load(sess, meta_graph.meta_info_def.tags,
savedmodel_dir)
frozen_graph_def = tf.graph_util.convert_variables_to_constants(sess,
graph.as_graph_def(),
output_node_names= ["chexnet_sigmoid_tensor", "categories"])
#remove the unnecessary training nodes
cleaned_frozen_graph = tf.graph_util.remove_training_nodes(frozen_graph_def)
write_graph_to_file(_GRAPH_FILE, cleaned_frozen_graph, output_dir)
return cleaned_frozen_graph
Command line example to execute the chexnet.py file:
python3 chexnet.py \
--train_epochs=15 \
--learning_rate=0.001 \
--batch_size=128 \
--data_dir='/home/chexnet_tfrecords’ \
--pretrained_model_dir='/home/resnet_v2_imagenet_checkpoint/ \
--model_dir='/home/chest-x-ray/chexnet_checkpoints' \
--export_dir='/home/chest-x-ray/chexnet_saved_model/ \
--frozen_graph_dir='/home/chest-x-ray/chexnet_frozen_graph/
Files used for development:
Script:
chexnet.py
Base model
script:
TensorFlow official
ResnetV2_50
resnet_model.py