Hi,
I am trying to convert the Tensorflow Version of Mobilenet_v2 to a Tensor RT Version. I have been using the following Project ( https://github.com/NVIDIA-Jetson/tf_to_trt_image_classification#models ) to learn how to convert Tensorflow Models. My issue occurs when I am trying to convert the frozen graphs to plans
Command Line:
python scripts/frozen_graphs_to_plans_mob_2.py
Traceback (most recent call last):
File “scripts/frozen_graphs_to_plans_mob_2.py”, line 9, in
from model_meta_mob_2 import NETS, FROZEN_GRAPHS_DIR, CHECKPOINT_DIR, PLAN_DIR
File “/home/nvidia/tf_to_trt_image_classification/scripts/model_meta_mob_2.py”, line 71, in
‘model’: mobilenet_v2_1p0_224,
NameError: name ‘mobilenet_v2_1p0_224’ is not defined
Where frozen_graphs_to_plans_mob_2.py, is a modified Version of the frozen_graphs_to_plans.py given in the Project. The same applies to the model_meta_mob_2.py file.
The only changes made to the frozen_graphs_to_plans.py file are that on line 6 I have ‘from model_meta_mob_2 Import Nets’ instead of ‘model_meta Import Nets’
The changes to model_meta_mod_2.py file are that I added;
‘Import slim.nets.mobilenet_v2’
and added to following to the NETS section;
‘mobilenet_v2_1p0_224’: {
‘model’: mobilenet_v2_1p0_224,
‘arg_scope’: nets.mobilenet_v2.mobilenet_v2_arg_scope,
‘num_classes’: 1001,
‘input_name’: ‘input’,
‘input_width’: 224,
‘input_height’: 224,
‘input_channels’: 3,
‘output_names’: [‘MobilenetV2/Logits/SpatialSqueeze’],
‘checkpoint_filename’: CHECKPOINT_DIR +
‘mobilenet_v2_1.0_224.ckpt’,
‘frozen_graph_filename’: FROZEN_GRAPHS_DIR + ‘mobilenet_v2_1p0_224.pb’,
‘plan_filename’: PLAN_DIR + ‘mobilenet_v2_1p0_224.plan’,
‘preprocess_fn’: preprocess_inception,
‘postprocess_fn’: postprocess_inception,
},
Other bits of info:
I have downloaded the checkpoints for MobileNet_V2_1.0_224 from https://github.com/tensorflow/models/tree/master/research/slim/nets/mobilenet
I am trying to run this on a Jetson TX2, with the lastest Version of Jetpack 3.2 and I have tensorflow 1.5 installed.
Any help would be greatly appreciated