question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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.9
  • Packages: [ 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:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dhiganthraocommented, Jul 14, 2021

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.

1reaction
dhiganthraocommented, Jun 1, 2021

Hey there! Thanks for bringing this issue up. We’ll try reproducing this issue and get back to you in some time!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found