Skip to content

could not load pretrained resnet50 #11

@renaldfredy

Description

@renaldfredy

Hi Erika,

I got error about the shape of resnet, and could not solved it. May you help?

==> could not load pretrained resnet50
/usr/local/lib/python3.10/dist-packages/keras/src/models/functional.py:225: UserWarning: The structure of inputs doesn't match the expected structure: ['image_patch', 'image']. Received: the structure of inputs={'image': '', 'image_patch': ''}
warnings.warn(
Traceback (most recent call last):
File "/content/drive/MyDrive/Disertasi/Class-Agnostic-Counting/class-agnostic-counting/demo.py", line 56, in
inference(args)
File "/content/drive/MyDrive/Disertasi/Class-Agnostic-Counting/class-agnostic-counting/demo.py", line 36, in inference
pred = model.predict(data)[0, :vis_im.shape[0], :vis_im.shape[1]]
File "/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 122, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/usr/local/lib/python3.10/dist-packages/keras/src/layers/input_spec.py", line 245, in assert_input_compatibility
raise ValueError(
ValueError: Exception encountered when calling Functional.call().

Input 0 of layer "resnet50_patchnet" is incompatible with the layer: expected shape=(None, 63, 63, 3), found shape=(1, 800, 800, 3)

Arguments received by Functional.call():
• inputs={'image': 'tf.Tensor(shape=(1, 800, 800, 3), dtype=float32)', 'image_patch': 'tf.Tensor(shape=(1, 63, 63, 3), dtype=float32)'}
• training=False
• mask={'image': 'None', 'image_patch': 'None'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions