Skip to content

Support for TensorflowFasterRCNN with TF2 #1616

@lcadalzo

Description

@lcadalzo

Is your feature request related to a problem? Please describe.
I'd like to instantiate a TensorflowFasterRCNN object detector with publicly available pretrained weights using TF2

Describe the solution you'd like
Proper handling of checkpoint restoration. The current method is not compatible with TF2. There may be other places in the codebase which assume TF1 that I just haven't hit yet due to this error.

Additional context
I'm working in a TF2 environment. Armory will be deprecating use of TF1 in its next release.

The minimum amount of code needed to reproduce the error should be as follows:

import armory
from art.estimators.object_detection.tensorflow_faster_rcnn import TensorFlowFasterRCNN
import tensorflow.compat.v1 as tf

tf.disable_eager_execution()

images = tf.placeholder(tf.float32, shape=(1, None, None, 3))

model = TensorFlowFasterRCNN(
    images,
    model=None,
    filename="faster_rcnn_inception_resnet_v2_640x640_coco17_tpu-8",
    url="http://download.tensorflow.org/models/object_detection/tf2/20200711/faster_rcnn_inception_resnet_v2_640x640_coco17_tpu-8.tar.gz",
)

Please see this Armory PR for a description of the error that ensues.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions