Open renaldfredy opened 1 month ago
Hi, does your input data consist of an image of size 800x800 and image patch of size 63x63?
Yes, as your instruction in the description
Is this your custom data or the example data? Are you able to run the demo successfully?
This is example data from yours, and still unable to run the demo
Hi, I wasn't able to reproduce the error using the Conda environment. What versions are you using for tensorflow, keras, etc.?
I’m using google colab, so actually no need to download tensorslow and keras. However, I have check those version specifically python 3.10.12, keras 3.4.1, tensorflow 2.17.0
The versions required are keras 2.4.3 and tensorflow 2.2.0, could you please try with those?
Okay all done properly, thank you. But it seems like hitmap_vis.jpg quiet different with your paper.
heatmap_vis overlays the prediction in green on top of the input image for visualization purposes.
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
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().
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, inInput 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'}