Comments (6)
@sachinprasadhs @fchollet @ianstenbit
To resolve the error in this thread, should I limit max_box to 32 again in inference(after model training) as well, how?
I guess the issue is with unbatching; Copying from documentation;
visualization_ds = eval_ds.unbatch()
visualization_ds = visualization_ds.ragged_batch(16)
visualization_ds = visualization_ds.shuffle(8)
FYI, the image data I use are small, so I padded to 640 by 640 pixels using a resizing layer for training, should I use the resizing layer somehow in inference as well?
from keras-cv.
@Paryavi I think your issue is ragged tensor with keras 3, which doesn't support yet.
NotImplementedError: bounding_box.to_ragged was called using a backend which does not support ragged tensors. Current backend: tensorflow.
Maybe, you can do padding instead.
preprocessor = keras.Sequential(
layers=[
keras_cv.layers.Resizing(
input_shape,
input_shape,
bounding_box_format=bbox_format,
pad_to_aspect_ratio=True
),
],
)
def pad_fn(inputs):
inputs["bounding_boxes"] = keras_cv.bounding_box.to_dense(
inputs["bounding_boxes"], max_boxes=32
)
return inputs
visualization_ds = eval_ds.unbatch()
visualization_ds = visualization_ds.ragged_batch(16)
visualization_ds = visualization_ds.map(
preprocessor, num_parallel_calls=tf.data.AUTOTUNE
)
visualization_ds= visualization_ds.map(
pad_fn, num_parallel_calls=tf.data.AUTOTUNE
)
visualization_ds= visualization_ds.prefetch(tf.data.AUTOTUNE)
from keras-cv.
Thanks @innat-asj
I use the padding in the training the model section, and also I used your padding code after training the model (.fit), but I get this error when running the last part of your code;
visualization_ds = visualization_ds.map(
preprocessor, num_parallel_calls=tf.data.AUTOTUNE
)
visualization_ds= visualization_ds.map(
pad_fn, num_parallel_calls=tf.data.AUTOTUNE
)
visualization_ds= visualization_ds.prefetch(tf.data.AUTOTUNE)
Error:
TypeError Traceback (most recent call last)
in <cell line: 1>()
----> 1 visualization_ds = visualization_ds.map(
2 preprocessor, num_parallel_calls=tf.data.AUTOTUNE
3 )
4 visualization_ds= visualization_ds.map(
5 pad_fn, num_parallel_calls=tf.data.AUTOTUNE
18 frames
/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py in error_handler(*args, **kwargs)
155 bound_signature = None
156 try:
--> 157 return fn(*args, **kwargs)
158 except Exception as e:
159 if hasattr(e, "_keras_call_info_injected"):
TypeError: Sequential.call() got multiple values for argument 'training'
from keras-cv.
@Paryavi what backend are you using? and what is the input tensor's backend? because JAX and pytorch does not support ragged tensors.
from keras-cv.
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.
from keras-cv.
This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.
from keras-cv.
Related Issues (20)
- Boxes from TensorFlow Serving HOT 5
- KerasCV on Google Colab HOT 7
- How does Keras-YOLOv7 deal with conv2d layer padding bug? HOT 6
- Getting 'Killed' while trying to run 'pytest keras_cv' HOT 4
- Support `CutMix` for video data HOT 8
- Issue with KerasCV list of models in the documlentation
- CLIP result seems wrong HOT 5
- Add test for `roi_align`
- Import `keras_cv` fails on current master HOT 5
- Inconsistency between PyCOCOCallback and BoxCOCOMetrics HOT 2
- `bounding_box.to_ragged()` fails with keras 3. HOT 3
- Add Depth-Anything HOT 2
- Metrics for YOLOv8 model HOT 6
- Division of data into training and validation set & COCO Metric Callback not working with Keras CV implementation as expected HOT 1
- About YoloV8 License HOT 6
- rules for `pyramid_level_inputs`?
- Bounding Box Cropping Layer: Feature Request HOT 1
- keras_cv.src.backend.keras' has no attribute 'src HOT 10
- Resizing layer with mixed_precision HOT 2
- MobileNetv4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras-cv.