Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected image (JPEG, PNG, or GIF),get /000/000/000 #14

Open
aboy2018 opened this issue Jun 19, 2019 · 3 comments
Open

Expected image (JPEG, PNG, or GIF),get /000/000/000 #14

aboy2018 opened this issue Jun 19, 2019 · 3 comments

Comments

@aboy2018
Copy link

No description provided.

@aboy2018 aboy2018 reopened this Jun 19, 2019
@aboy2018 aboy2018 changed the title How to chose network parameter in training? How to choose network parameter in training? Jun 20, 2019
@aboy2018 aboy2018 changed the title How to choose network parameter in training? what is the training environment? tf1.12.0 not work Jun 21, 2019
@aboy2018 aboy2018 changed the title what is the training environment? tf1.12.0 not work How to make tfrecords dataset? Jun 21, 2019
@aboy2018
Copy link
Author

tensorflow.python.framework.errors_impl.InvalidArgumentError: Expected image (JPEG, PNG, or GIF), got unknown format starting with '\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000'

@aboy2018 aboy2018 changed the title How to make tfrecords dataset? Expected image (JPEG, PNG, or GIF),get /000/000/000 Jun 24, 2019
@PatrickFeng
Copy link

Suppose you generating your tfrecord data in a incorrect way.
You can reference the official tutorial of converting CIFAR-10 dataset to .tfrecord files:
https://github.com/tensorflow/models/blob/master/tutorials/image/cifar10_estimator/generate_cifar10_tfrecords.py

@PatrickFeng
Copy link

Suppose you generating your tfrecord data in a incorrect way.
You can reference the official tutorial of converting CIFAR-10 dataset to .tfrecord files:
https://github.com/tensorflow/models/blob/master/tutorials/image/cifar10_estimator/generate_cifar10_tfrecords.py

If you follow the official tutorial to generate your tfrecord data, some minor changes should be done in inputs.py. Some of 'image' and 'label' in function _parse_serialized_example() and _preprocess_example() should be replaced by 'image/encoded' and 'image/class/label' like:

def _preprocess_example(self, serialized_example):
    parsed_example = self._parse_serialized_example(serialized_example)
    image = self._preprocess_image(parsed_example['image/encoded'])
    return {'image': image}, parsed_example['image/class/label']

@staticmethod
def _parse_serialized_example(serialized_example):
    features = {
        'image/encoded': tf.FixedLenFeature([], tf.string),
        'image/class/label': tf.FixedLenFeature([], tf.int64),
    }
    return tf.parse_single_example(serialized=serialized_example,
                                   features=features)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants