keras-team / keras-io

Keras documentation, hosted live at keras.io
Apache License 2.0
2.73k stars 2.03k forks source link

'OxfordPets' object has no attribute 'ndim' Error #125

Closed akare55 closed 5 months ago

akare55 commented 4 years ago

Hi everyone, When I try to run keras-io/examples/vision/oxford_pets_image_segmentation.py. I get 'OxfordPets' object has no attribute 'ndim' Error. Could you help me about this?

pcoet commented 1 year ago

Note: We should add a pip install command for KerasCV, so that the notebook doesn't throw an error on the first cell:

!pip install --upgrade -q git+https://github.com/keras-team/keras-cv

pcoet commented 1 year ago

The notebook throws an error when you try to create the training and validation sets. Needs further investigation.

Error details:
        Tensor("sequential/rand_augment/cond/random_choice/switch_case/indexed_case/Identity_1:0", shape=(160, 160, 1), dtype=float32) and Tensor("sequential/rand_augment/cond/random_choice/switch_case/indexed_case/Identity_1:0", shape=(160, 160, 1), dtype=int64) have different types

    Call arguments received by layer 'random_choice' (type RandomChoice):
      • inputs={'images': 'tf.Tensor(shape=(160, 160, 3), dtype=float32)', 'segmentation_masks': 'tf.Tensor(shape=(160, 160, 1), dtype=int64)'}

Call arguments received by layer 'rand_augment' (type RandAugment):
  • inputs={'images': 'tf.Tensor(shape=(160, 160, 3), dtype=float32)', 'segmentation_masks': 'tf.Tensor(shape=(160, 160, 1), dtype=int64)'}
sachinprasadhs commented 6 months ago

Hi,

The example has been updated to Keras 3 with many changes and now it is running successfully, please find the Gist here for more details https://keras.io/examples/vision/oxford_pets_image_segmentation/

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

github-actions[bot] commented 5 months ago

This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

github-actions[bot] commented 5 months ago

Are you satisfied with the resolution of your issue? Yes No