[BUG] Example not working
See original GitHub issue🐛🐛 Bug Report
When I run the example at https://docs.activeloop.ai/getting-started/creating-datasets-manually. I get an error.
⚗️ Current Behavior
ds.labels.append(label) # Append to labels tensor
Dtype was expected to be ‘uint32’ instead it was ‘int64’. If you called create_tensor
explicitly with dtype
, your samples should also be of that dtype. Htype ‘class_label’ expects samples to have dtype=‘uint32’.
⚙️ Environment
Python: [3.7.1. 64 bit ]
🧰 Possible Solution (optional)
workaround solves this
ds.labels.append(np.asarray([label]).astype(np.uint32)[0])
another option is to make the dtype of the tensor 64 bit.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
How to get all your bugs resolved without any 'Invalid bug' label?
#2) Check if your Database is proper: Missing table might be the main reason that your application will not work properly. A classic...
Read more >How to fix bugs, step by step - Software Engineering Tips
Step 3: Identify the immediate line of code where the bug occurs ... If it's a crashing bug then try running the program...
Read more >Difference between Bugs, Errors and Issues | BrowserStack
The term Bug refers to any shortcoming in a software system that causes it to behave in unexpected and undesirable ways. These could...
Read more >How do you fix a bug you can't replicate? - Stack Overflow
Gather hard numerical data on the problem. A problem that might, at first, appear random, might actually have a pattern. Change Management. Sometimes...
Read more >Bug Types (Summary) | Test IO Academy
A bug is a software-related problem. If something on a website or in an application does not work as intended, this “error” is...
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
yes, I know how to update the type 😃 that isn’t the problem. I just wanted to note that the example doesn’t work out of the box 😃 so it is probably better to cast to the expected numpy type by the suggested modification (ds.labels.append(np.uint32(label)) )
ds.labels.append(np.asarray([label]).astype(np.uint32)[0])
can instead be:
ds.labels.append(np.uint32(label))