tensorflow / tensorflow/datasets

Getting error when serialize a tfds object

Open
#3,085 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help
Dominant language
Python
Stars
4.6k
Forks
1.6k
Avg merge
3h 54m
Merged PRs (30d)
1

Description

What I need help with / What I was wondering
I have tried serialize the response object from this code:

import tensorflow_datasets as tfds
(ds_train, ds_test), ds_info = tfds.load(
    'mnist',
    split=['train', 'test'],
    shuffle_files=True,
    as_supervised=True,
    with_info=True,
)
response = {
  "ds_train": ds_train,
  "ds_test": ds_test,
  "ds_info": ds_info,
}

But when i use the pickle.dump method to convert this dict to a binary file this exception is throwed:
tensorflow.python.framework.errors_impl.InternalError: Tensorflow type 21 not convertible to numpy dtype.

Can someone help me?

Environment information
(if applicable)

  • Operating System: Debian
  • Python version: 3.7
  • tensorflow-datasets/tfds-nightly version: stable

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the pickle.dump failure with the shown MNIST tfds.load example under Python 3.7, Debian, and the stable tensorflow-datasets version. No repository file, entry point, or test is named; done means determining whether these response objects are supported for serialization and capturing the result in a focused regression check or documented resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
data, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.