Skip to content

[Question]: Tensorflow.RuntimeError : 'Attempting to capture an EagerTensor without building a function.' #1040

Open
@Cilouche

Description

@Cilouche

Description

Hi, I'm working on this "crop_to_bounding_box()" function in order to Crop an image to a specified bounding box.
But I get this error in "crop_to_bounding_box()" function

Tensorflow.RuntimeError: 'Attempting to capture an EagerTensor without building a function.'
any suggestion, please

the code :

var image = tf.image.decode_jpeg(tf.io.read_file(filname),1);
// Set the variable values here
//Offset variables values
var offset_height = 20;
var offset_width = 20;
// Target variables values
var target_height = 20;
var target_width = 20;
var graph = tf.Graph().as_default();
var ts = tf.image.crop_to_bounding_box(image, offset_height, offset_width, target_height, target_width);

Alternatives

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions