tf_to_trt_image_classification icon indicating copy to clipboard operation
tf_to_trt_image_classification copied to clipboard

Converting face_classification-emotion_models (tensorflow) to TensorRT

Open santhoshnumberone opened this issue 4 years ago • 1 comments

Trying the first step tf_to_trt_image_classification/scripts/models_to_frozen_graphs.py

Please guide on the second part of this question Trying to convert emotion detection into TensorRT

What should be the output_names of the custom model be?


emotion_labels = get_labels('fer2013')
emotion_model_path = 'trained_models/emotion_models/fer2013_mini_XCEPTION.102-0.66.hdf5'
emotion_classifier = load_model(emotion_model_path, compile=False)
'emotions': {
		'model': emotion_classifier ,
		'arg_scope': emotion_arg_scope, # what should this be changed to
		'num_classes': 7,
		'input_name': 'input', # what should this be changed to
		'output_names': ['InceptionResnetV2/Logits/Logits/BiasAdd'],, # what should this be changed to
		'input_width': 64,
		'input_height': 64,
		'input_channels': 1, 
		'preprocess_fn': preprocess_emotion, #preprocessing 
		'postprocess_fn': postprocess_emotion, #postprocessing
		'checkpoint_filename': CHECKPOINT_DIR + 'emotions.ckpt', 
		'frozen_graph_filename': FROZEN_GRAPHS_DIR + 'emotions.pb',
		'trt_convert_status': "works", # what should this be changed to
		'plan_filename': PLAN_DIR + 'inception_resnet_v2.plan' # what should this be changed to
	}}

santhoshnumberone avatar Oct 04 '19 15:10 santhoshnumberone

maybe you can try 'InceptionResnetV2/Logits/Predictions'

250zhanghu avatar Dec 18 '20 13:12 250zhanghu