Community
cancel
Showing results for 
Search instead for 
Did you mean: 
chen__ives
Beginner
150 Views

[ ERROR ] Wrong replacement syntax. Use --freeze_placeholder_with_value node1_name->value1,node2_name->value2

Jump to solution

In R3, I follow $(Intel_CV_SDK)\deployment_tools/documentation/docs/FaceNetTF.html to covert facenet pre-trained model,  ​

python3 ./mo_tf.py
--input_model path_to_model/model_name.pb       \
--freeze_placeholder_with_value phase_train->False
 

But it returns error

[ ERROR ]  Wrong replacement syntax. Use --freeze_placeholder_with_value node1_name->value1,node2_name->value2

 

Do you have any suggestion? Thank you very much.

 

 

 

0 Kudos

Accepted Solutions
Severine_H_Intel
Employee
150 Views

Dear Ives, 

you need to put the arguments in between quotes such as it works. 

python3 ./mo_tf.py

--input_model path_to_model/model_name.pb       \

--freeze_placeholder_with_value "phase_train->False"

We will update our documentation accordingly.

Best, 

Severine

View solution in original post

9 Replies
Severine_H_Intel
Employee
151 Views

Dear Ives, 

you need to put the arguments in between quotes such as it works. 

python3 ./mo_tf.py

--input_model path_to_model/model_name.pb       \

--freeze_placeholder_with_value "phase_train->False"

We will update our documentation accordingly.

Best, 

Severine

View solution in original post

Mickael_T
Beginner
150 Views

I am using an OpenVino release with computer_vision_sdk_2018.2.319. I have downloaded the Facenet pre-trained model. If I try to call model optimizer with --freeze_placeholder_with_value parameter, I am getting an error. This parameter is not available on the current version of the model optimizer (2018.2.319)

Please confirm what is the step in that case. Thank you!

Logs with version number:

xxxx@sashimi:/opt/intel/computer_vision_sdk_2018.2.319/deployment_tools/model_optimizer$ sudo python3 ./mo_tf.py --input_model ~/Documents/ML/FaceNet/PreTrained2018/20180402-114759/20180402-114759.pb --freeze_placeholder_with_value "phase_train->False"
usage: mo_tf.py [-h] [--input_model INPUT_MODEL] [--model_name MODEL_NAME]
                [--output_dir OUTPUT_DIR] [--input_shape INPUT_SHAPE]
                [--scale SCALE] [--reverse_input_channels]
                [--log_level {CRITICAL,ERROR,WARN,WARNING,INFO,DEBUG,NOTSET}]
                [--input INPUT] [--output OUTPUT] [--mean_values MEAN_VALUES]
                [--scale_values SCALE_VALUES]
                [--data_type {FP16,FP32,half,float}] [--disable_fusing]
                [--disable_resnet_optimization]
                [--finegrain_fusing FINEGRAIN_FUSING] [--disable_gfusing]
                [--move_to_preprocess] [--extensions EXTENSIONS]
                [--batch BATCH] [--version] [--silent]
                [--input_checkpoint INPUT_CHECKPOINT]
                [--saved_model_dir SAVED_MODEL_DIR] [--input_meta]
                [--saved_model_tags SAVED_MODEL_TAGS] [--input_model_is_text]
                [--offload_unsupported_operations_to_tf]
                [--tensorflow_subgraph_patterns TENSORFLOW_SUBGRAPH_PATTERNS]
                [--tensorflow_operation_patterns TENSORFLOW_OPERATION_PATTERNS]
                [--tensorflow_custom_operations_config_update TENSORFLOW_CUSTOM_OPERATIONS_CONFIG_UPDATE]
                [--tensorflow_use_custom_operations_config TENSORFLOW_USE_CUSTOM_OPERATIONS_CONFIG]
                [--tensorboard_logdir TENSORBOARD_LOGDIR]
mo_tf.py: error: unrecognized arguments: --freeze_placeholder_with_value phase_train->False

 

nikos1
Valued Contributor I
150 Views

FWIW model optimizer for facenet works fine in R3 on my Ubuntu box.

you need to put the arguments in between quotes such as it works. 

Thanks to Severine for the tip!

[ SUCCESS ] Generated IR model.

 

Mickael_T
Beginner
150 Views

Hi Nikos,

This is what I did:

xxxx@sashimi:/opt/intel/computer_vision_sdk_2018.2.319/deployment_tools/model_optimizer$ sudo python3 ./mo_tf.py --input_model ~/Documents/ML/FaceNet/PreTrained2018/20180402-114759/20180402-114759.pb --freeze_placeholder_with_value "phase_train->False"

It does not work for me.

I have put "phase_train->False" as indicated in the initial post. My model optimizer does not even recognize the option --freeze_placeholder_with_value

 

Suggestions?

nikos1
Valued Contributor I
150 Views

Mickael could you please try the latest release of the SDK as facenet support was recently added.

I am using computer_vision_sdk_2018.3.343 .

Cheers!

chen__ives
Beginner
150 Views

Thanks for Severine's suggestion, also thanks for Nikos's kindly share, by using --freeze_placeholder_with_value "phase_train->False" , now I can covert facenet model to IR!

This is really one of best things since I start to use OpenVINO in June.

Mickael_T
Beginner
150 Views

R3 it is! I also confirmed a successful processing of a 2017 FaceNet trained model:

xxxxxxx@sashimi:/opt/intel/computer_vision_sdk_2018.3.343/deployment_tools/model_optimizer$ sudo python3 ./mo_tf.py --input_model ~/Documents/ML/FaceNet/PreTrained2017/20170511-185253/20170511-185253.pb --freeze_placeholder_with_value "phase_train->False" --log_level DEBUG

...

[ SUCCESS ] Generated IR model.
[ SUCCESS ] XML file: /opt/intel/computer_vision_sdk_2018.3.343/deployment_tools/model_optimizer/./20170511-185253.xml
[ SUCCESS ] BIN file: /opt/intel/computer_vision_sdk_2018.3.343/deployment_tools/model_optimizer/./20170511-185253.bin
[ SUCCESS ] Total execution time: 47.95 seconds.
xxxxxxx@sashimi:/opt/intel/computer_vision_sdk_2018.3.343/deployment_tools/model_optimizer$

Thank you everyone for the inputs!

 

 

 

nikos1
Valued Contributor I
150 Views

Glad to hear Mickael.

BTW have you also managed to run inference with the generated IR model? if so on what device (CPU, GPU, other) ?

Mickael_T
Beginner
150 Views

Hi Nikos,

This is work in progress (I am creating the unit tests this week before running on our face detection application). I will create another post with the state of the tests. The initial target for inferencing is the Iris GPU. We are replacing SphereFace with FaceNet, so I will be running some performance and accuracy tests. I also do have Movidius USB stick and Arria10 Dev Kit (they are on my test list for later).