[BUG] Sequences of fixed vs varying size handled inconsistently
See original GitHub issue🐛🐛 Bug Report
⚗️ Current Behavior
Input Code
import hub
from hub.schema import Text, Sequence
@hub.transform(schema={"txts": Sequence(dtype=Text(max_shape=(100,)))})
def transform_ds(txts):
return {"txts": txts}
# This works
rows = [
["one", "two"],
["one", "two", "three"],
]
transform_ds(rows).store("./tmp_ds")
# This throws `ValueError: parameter 'value': expected array with shape (2,), got (2, 2)`
rows = [
["one", "two"],
["one", "two"],
]
transform_ds(rows).store("./tmp_ds")
Expected behavior
I would expect it to work consistently across “ragged” sequences (rows with varying length) as well as ones where each row has the same number of elements.
⚙️ Environment
Python
version: 3.6.9Packages
: [hub==1.3.5
,zarr==2.7.1
]
🧰 Possible Solution (optional)
zarr.indexing.BasicIndexer.shape == (2,)
in both of the above cases, which seems wrong. Not sure if this is a bug with zarr
or hub
is calling zarr
incorrectly.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Bugs in PHYLIP, known or recently fixed
The program Mix did not handle weights at all. You could use Pars instead (where the weights are specified in a separate file...
Read more >[default_collate] Batch with inconsistent sequence length ...
IMHO, the pitch seems not for general cases. First, we should not provide a fixed way to handle non-equal size batch as suggested...
Read more >Bugs that are fixed in SQL Server 2012 Service Pack 2
This article lists the bugs that are fixed in Microsoft SQL Server 2012 Service Pack 2 (SP2). ... SSMS handles Numbered Stored procedures...
Read more >Do Transformers process sequences of FIXED or of ... - YouTube
Explaining the answer to the following AI Coffee Break Quiz question: “Do Transformers process sequences of fixed or of variable length ?
Read more >Release Notes for Sequence Viewer 3.47 (November 29, 2022)
Fixed a bug in detecting consensus splice sites in intron feature tracks · Fixed a bug in setting a minimum range for graph-style...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Closing this issue, as dynamic sequences are properly handled in 2.0. @mattiasarro, @FayazRahman - I’m also excited to announce we’ve released the 2.0 community beta - you can try it out using pip (
pip install hub
). You can access the docs here, and access some small tutorials to get started with 2.0 here! You can also let me know if you run into any issues, I’ll be happy to help! If you haven’t, please consider joining our Community Slack to receive further updates.Hey there! Thanks for bringing this issue up. We’ll try reproducing this issue and get back to you in some time!