ahmadchalhoub

ahmadchalhoub

Member Since 2 months ago

0 organizations

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
1
repos

5 contributions in the last year

ahmadchalhoub Most Used Languages
ahmadchalhoub GitHub Stats

1 Pinned

⚡ Models and examples built with TensorFlow
Aug
2
3 days ago
Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

I will work on doing that! I've been extremely busy but I'll try to get a PR sent to you as soon as I can.

Jul
29
1 week ago
Activity icon
fork

ahmadchalhoub forked tensorflow/models

⚡ Models and examples built with TensorFlow
ahmadchalhoub Apache License 2.0 Updated
fork time in 6 days ago
Jul
22
2 weeks ago
Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Thank you! I'll remember to do this for future compilations of TF!

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Also, I am confused on how meta_optimizer.cc isn't on my laptop at all, yet it is still called during the process. From what I know, I can locate meta_optimizer.cc when I build TensorFlow from source, but when installing with pip, which is what I have now, I am not able to locate it.

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Wasn't TF2 used during that commit?

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

It doesn't seem like using the whole commit with TensorFlow 2 would be the best idea. I faced a compatibility error so far while training a model using model_main_tf2.py due to some TF libraries.

I think the best overall solution for my issue, which is what I previously have done, is to use the newest TF2 OD API (master) and just use the exporter_main_v2.py and exporter_lib_v2.py scripts from the first commit https://github.com/tensorflow/models/commit/420a7253e034a12ae2208e6ec94d3e4936177a53#diff-b1be120e3a86ccd8af2165d2b081db4c3ab9e0fed6ac6147253f445a303ed746

I hope the TensorFlow team takes this issue into consideration for future updates.

Nonetheless, you guys have really been of unbelievable help and assistance, so thank you again!

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub
Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Thank you!

So what I should do is the following? git clone https://github.com/tensorflow/models.git git checkout --detach 420a725 cd models/research protoc object_detection/protos/*.proto --python_out=. cp object_detection/packages/tf2/setup.py . python -m pip install --use-feature=2020-resolver .

If so, I am facing the following error when I execute the protoc object_detection/protos/*.proto --python_out=. command: object_detection/protos/input_reader.proto: warning: Import object_detection/protos/image_resizer.proto but not used.

and then the following error when I execute the cp object_detection/packages/tf2/setup.py . command: cp: cannot stat 'object_detection/packages/tf2/setup.py': No such file or directory

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

I'm not sure what you mean by being on 'git checkout'. I'm not very familiar with the structure of things on GitHub, as I don't have that much experience. Is it possible to view all commits to a repo anywhere?

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

@bhack wouldn't the installation instructions at https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md#python-package-installation just install the latest commit? Is there any additional steps to do to target the specific commit that is desired?

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

@amith-gowda I was having a bit of a hard time trying to target that specific commit too, as I'm not very experienced as well. I just replaced the exporter_main_v2.py and exporter_lib_v2.py files in my TF2 OD API installation with the the scripts for those files found in the commit. That seemed to work fine for me.

If you do end up knowing how to use that specific commit as a whole, please do let me know. I'm sure it would be much safer and more reliable to approach it that way.

Jul
20
2 weeks ago
Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub
Jul
19
2 weeks ago
Activity icon
issue

ahmadchalhoub issue tensorflow/tensorflow

ahmadchalhoub
ahmadchalhoub

TF2 ‘saved_model.pb’ from ‘exporter_main_v2.py’ is different than ‘saved_model.pb’ from official TF2 Zoo

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04 Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: - TensorFlow installed from (source or binary): pip TensorFlow version (use command below): 2.3.0 Python version: 3.6.9 Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: CUDA 11.4 GPU model and memory: GeForce RTX 3090 I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph AAEA8FD8-1609-4BAC-AE9B-53918E23EA20

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

Activity icon
issue

ahmadchalhoub issue comment tensorflow/tensorflow

ahmadchalhoub
ahmadchalhoub

TF2 ‘saved_model.pb’ from ‘exporter_main_v2.py’ is different than ‘saved_model.pb’ from official TF2 Zoo

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04 Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: - TensorFlow installed from (source or binary): pip TensorFlow version (use command below): 2.3.0 Python version: 3.6.9 Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: CUDA 11.4 GPU model and memory: GeForce RTX 3090 I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph AAEA8FD8-1609-4BAC-AE9B-53918E23EA20

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

I am closing this issue since it has been resolved on the original issue post (https://github.com/tensorflow/models/issues/10120)

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

@vighneshbirodkar I exported my model using the (420a725#diff-b1be120e3a86ccd8af2165d2b081db4c3ab9e0fed6ac6147253f445a303ed746) commit and it solved the issue! Thank you so much! The converter was able to pass through the exported saved_model.pb exactly like it did with the one distributed in the official repo!

Thank you again so much, you have been a lifesaver. I really appreciate your constant help! @vighneshbirodkar @bhack

Jul
17
2 weeks ago
Activity icon
issue

ahmadchalhoub issue comment tensorflow/tensorflow

ahmadchalhoub
ahmadchalhoub

TF2 ‘saved_model.pb’ from ‘exporter_main_v2.py’ is different than ‘saved_model.pb’ from official TF2 Zoo

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04 Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: - TensorFlow installed from (source or binary): pip TensorFlow version (use command below): 2.3.0 Python version: 3.6.9 Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: CUDA 11.4 GPU model and memory: GeForce RTX 3090 I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph AAEA8FD8-1609-4BAC-AE9B-53918E23EA20

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Thank you for the suggestion! I do not have access to my computer at the moment but I will try it within the coming 2 days and I will keep you updated.

Activity icon
issue

ahmadchalhoub issue comment tensorflow/tensorflow

ahmadchalhoub
ahmadchalhoub

TF2 ‘saved_model.pb’ from ‘exporter_main_v2.py’ is different than ‘saved_model.pb’ from official TF2 Zoo

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04 Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: - TensorFlow installed from (source or binary): pip TensorFlow version (use command below): 2.3.0 Python version: 3.6.9 Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: CUDA 11.4 GPU model and memory: GeForce RTX 3090 I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph AAEA8FD8-1609-4BAC-AE9B-53918E23EA20

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

I have not heard of sha256sum before to be honest and not sure how to use it. Any guidance/details you could help with? What would I be looking for exactly?

Activity icon
issue

ahmadchalhoub issue comment tensorflow/tensorflow

ahmadchalhoub
ahmadchalhoub

TF2 ‘saved_model.pb’ from ‘exporter_main_v2.py’ is different than ‘saved_model.pb’ from official TF2 Zoo

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04 Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: - TensorFlow installed from (source or binary): pip TensorFlow version (use command below): 2.3.0 Python version: 3.6.9 Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: CUDA 11.4 GPU model and memory: GeForce RTX 3090 I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph AAEA8FD8-1609-4BAC-AE9B-53918E23EA20

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

I have had some discussion about this on the tensorflow/models repo and they suggested that I ask for https://github.com/tensorflow/models/issues/10120 assistance here. Refer to for details.

Activity icon
issue

ahmadchalhoub issue tensorflow/tensorflow

ahmadchalhoub
ahmadchalhoub

TF2 ‘saved_model.pb’ from ‘exporter_main_v2.py’ is different than ‘saved_model.pb’ from official TF2 Zoo

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04 Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: - TensorFlow installed from (source or binary): pip TensorFlow version (use command below): 2.3.0 Python version: 3.6.9 Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: CUDA 11.4 GPU model and memory: GeForce RTX 3090 I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

@bhack @vighneshbirodkar I have literally checked almost everything that I could think of to compare the saved_model.pb file from the official repo and the output saved_model.pb that resulted from the exporter_main_v2.py but cannot seem to find any difference. So I’m not sure why when I try to convert the file to another framework, the grappler optimizer is seeing my exported file as empty but not for the file.

Would it by any chance be possible for me to send you my checkpoint files and pipeline config and have someone export it for me internally to check if I can convert that output file?

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

are any ‘side_inputs’ used as arguments during the execution of exporter_main_v2.py? (I realize different models might have different answers but I’m mostly interested in http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz)

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Thank you @bhack!

@yarri-oss do you have any thoughts regarding this? I would really appreciate it.

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Yes that is where the confusion lies. Thank you very much though, I really hope your support through this!

Do you know anyone who works on this at TensorFlow that I can perhaps get in touch with here or on discuss.tensorflow.org? (I have tried to get in touch with Ms. Lea Thatkin since you’ve tagged her in our initial correspondence regarding this on the forum but it seems that she is away).

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

For TF2 models this function is used

https://github.com/tensorflow/models/blob/master/research/object_detection/exporter_lib_v2.py#L212

exporter_lib_v2.py is what’s called by exporter_main_v2.py to export the inference graph. So I would have to change something in exporter_lib_v2.py to get the same exact results as those in the TF2 Zoo official repos?

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Probably you can check

https://github.com/tensorflow/models/blob/078eaaf3ffdff0d503e032640a221ccaecd5e158/research/object_detection/exporter.py#L356

The exporter.py function is used to export TF1 models I believe. So I’m not sure how I would incorporate that to save my TF2 OD models?

Jul
16
2 weeks ago
Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Thank you. It did show TF2.4.0, so I changed my TensorFlow version to TF2.4.0 and to tf-models-official==2.4.0. I then tried exporter_main_v2.py and once I tried to convert the saved_model.pb, I face the same issue.

I'm wondering if the function used to save the saved_model.pb file internally at TensorFlow is different than the default function used in the public TensorFlow OD API? I was looking at the builder_impl.py' file (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/builder_impl.py) and it sayd at builder_impl.py:48` that there is a SavedModelBuilder used by TensorFlow internally and that users should be using another function to save models. @bhack

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

I'm trying to access it for my saved_model but I think I'm approaching this wrong.

`import tensorflow as tf

loaded_model = tf.saved_model.load('/home/achalhoub/Desktop/Summer_Project/Speed_Limit_Project/my_model_dir_3000_steps/exported_model/saved_model/') print(vars(loaded_model))`

Any tips on how to approach this?

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

I'm not sure I understand what the SAVED_MODEL_SCHEMA_VERSION is or how/where to check it. Would you mind giving me some direction please? @bhack

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

I understand your point, but if the conversion script to the proprietary framework is able to convert the official saved_model.pb file from the official repo but not the saved_model.pb file that is a result of the exporter_main_v2.py file, then that must mean that the officia saved_model.pb file was exported differently?

Activity icon
issue

ahmadchalhoub issue comment tensorflow/models

ahmadchalhoub
ahmadchalhoub

exporter_main_v2.py on official TF2 OD checkpoints produces saved_model.pb different than official saved_model.pb

Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 2.3.0
  • Python version: 3.6.9
  • Bazel version (if compiling from source): -
  • GCC/Compiler version (if compiling from source): -
  • CUDA/cuDNN version: CUDA 11.4
  • GPU model and memory: GeForce RTX 3090

I am trying to convert a re-trained TF2 object detection SSD MobilenetV2 model to a proprietary framework. I have successfully re-trained the network and it runs properly. However, I am having trouble with converting the saved_model.pb to the other framework. The conversion script from the SDK I am working with performs optimization on the saved_model.pb, using 'meta_optimizer.cc', which returns an empty graph after running through my re-trained model. I used 'exporter_main_v2.py' to export my re-trained checkpoint to the saved_model.pb which I am having trouble with.

The issue is not with my training or checkpoints, but with the exporting process from checkpoint to a saved_model.pb using 'exporter_main_v2.py'. I know this because I downloaded the SSD MobilenetV2 model from the TF2 Zoo to test with it. I have no issue converting the official saved_model.pb file found in the official repo, but when I try to convert the official checkpoints found in the repo to a saved_model.pb using 'exporter_main_v2.py', I face the same issue trying to convert the newly produced saved_model.pb file to the proprietary framework. This means that something wrong is happening when executing the 'exporter_main_v2.py' script.

Describe the expected behavior The exported saved_model.pb file should not be different than the official saved_model.pb file found in the official repo.

The following is what I get, showing 0 nodes and 0 edges grappler_empty_graph

Standalone code to reproduce the issue The model I downloaded is: http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_mobilenet_v2_320x320_coco17_tpu-8.tar.gz

The command I used to export the official checkpoint to a saved_model.pb is: python ~/models/research/object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path pipeline.config --trained_checkpoint_dir checkpoint/ --output_directory exported_model/

ahmadchalhoub
ahmadchalhoub

Yes, the script does produce an output (saved_model.pb) file which I can use properly for inference! However, the trouble I'm facing is that when I'm trying to convert this output saved_model.pb to the other proprietary framework that I'm working with (which uses grappler to optimize the graph), it is disconnecting the nodes (I think right after the input layer) and is returning a fully disconnected graph, which is seen an 'empty graph' that my converted can't work with.