-
Notifications
You must be signed in to change notification settings - Fork 14
Description
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'}