Issue 1:
I use cifar10 model training my dataset,which is made by tf.python_io.TFRecordWriter() .

I am sure labels in dataset are right,because it's running ok on Ubuntu PC but get Error Invalid argument: Received a label value of 255 which is outside the valid range of [0, 10) on Mac and GPU Server.

W tensorflow/core/framework/op_kernel.cc:975] Invalid argument: Received a label value of 255 which is outside the valid range of [0, 10). Label values: 65 229 184 161 102 117 112 160 66 93 107 117 131 122 129 132 113 163 149 130 75 52 109 84 161 165 99 203 82 42 57 179 155 63 126 49 172 50 144 224 152 220 164 82 195 169 171 125 107 127 70 60 93 115 165 143 78 116 60 153 113 62 89 175 125 90 85 178 167 200 133 168 125 92 62 93 166 141 98 172 102 103 72 179 138 108 49 176 46 70 55 101 141 144 107 126 60 146 108 77 125 59 58 109 171 107 63 151 55 93 172 131 52 128 75 167 255 97 108 171 113 130 77 166 150 132 62 196

Traceback (most recent call last):

File "/Users/yangk/cifar10/cifar10_train.py", line 137, in

tf.app.run()

File "/Library/Python/2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run

sys.exit(main(sys.argv[:1] + flags_passthrough))

File "/Users/yangk/cifar10/cifar10_train.py", line 133, in main

train()

File "/Users/yangk/cifar10/cifar10_train.py", line 103, in train

_, loss_value = sess.run([train_op, loss])

File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 766, in run

run_metadata_ptr)

File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 964, in _run

feed_dict_string, options, run_metadata)

File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 1014, in _do_run

target_list, options, run_metadata)

File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 1034, in _do_call

raise type(e)(node_def, op, message)

tensorflow.python.framework.errors_impl.InvalidArgumentError: Received a label value of 255 which is outside the valid range of [0, 10). Label values: 65 229 184 161 102 117 112 160 66 93 107 117 131 122 129 132 113 163 149 130 75 52 109 84 161 165 99 203 82 42 57 179 155 63 126 49 172 50 144 224 152 220 164 82 195 169 171 125 107 127 70 60 93 115 165 143 78 116 60 153 113 62 89 175 125 90 85 178 167 200 133 168 125 92 62 93 166 141 98 172 102 103 72 179 138 108 49 176 46 70 55 101 141 144 107 126 60 146 108 77 125 59 58 109 171 107 63 151 55 93 172 131 52 128 75 167 255 97 108 171 113 130 77 166 150 132 62 196

[[Node: cross_entropy_per_example/cross_entropy_per_example = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT64, _device="/job:localhost/replica:0/task:0/cpu:0"](softmax_linear/softmax_linear, Cast_4)]]

Caused by op u'cross_entropy_per_example/cross_entropy_per_example', defined at:

File "/Users/yangk/cifar10/cifar10_train.py", line 137, in

tf.app.run()

File "/Library/Python/2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run

sys.exit(main(sys.argv[:1] + flags_passthrough))

File "/Users/yangk/cifar10/cifar10_train.py", line 133, in main

train()

File "/Users/yangk/cifar10/cifar10_train.py", line 76, in train

loss = cifar10.loss(logits, labels)

File "/Users/yangk/cifar10/cifar10.py", line 289, in loss

logits, labels, name='cross_entropy_per_example')

File "/Library/Python/2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1537, in sparse_softmax_cross_entropy_with_logits

precise_logits, labels, name=name)

File "/Library/Python/2.7/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 2378, in _sparse_softmax_cross_entropy_with_logits

features=features, labels=labels, name=name)

File "/Library/Python/2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op

op_def=op_def)

File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 2371, in create_op

original_op=self._default_original_op, op_def=op_def)

File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 1258, in init

self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): Received a label value of 255 which is outside the valid range of [0, 10). Label values: 65 229 184 161 102 117 112 160 66 93 107 117 131 122 129 132 113 163 149 130 75 52 109 84 161 165 99 203 82 42 57 179 155 63 126 49 172 50 144 224 152 220 164 82 195 169 171 125 107 127 70 60 93 115 165 143 78 116 60 153 113 62 89 175 125 90 85 178 167 200 133 168 125 92 62 93 166 141 98 172 102 103 72 179 138 108 49 176 46 70 55 101 141 144 107 126 60 146 108 77 125 59 58 109 171 107 63 151 55 93 172 131 52 128 75 167 255 97 108 171 113 130 77 166 150 132 62 196

[[Node: cross_entropy_per_example/cross_entropy_per_example = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT64, _device="/job:localhost/replica:0/task:0/cpu:0"](softmax_linear/softmax_linear, Cast_4)]]

Issue 2:
I use the cifar10 model train my own TFRecord dataset ,it's running on Ubuntu 14.4 without error,but getting these errors when I run it on Mac or GPU server。And I am sure the labels of my dataset are right ,I don't know why get labels bigger than 10 ,I just have 10 classifications。

I use this code write images and labels in binfile:

image_raw = image.tostring()

example = tf.train.Example(features=tf.train.Features(feature={

'image_raw' : _bytes_feature(image_raw),

'height' : _int64_feature(image.shape[0]),

'width' : _int64_feature(image.shape[1]),

'deepth' : _int64_feature(image.shape[2]),

'label' : _int64_feature(label)

}))

writer.write(example.SerializeToString())

writer.close()

The errors:

W tensorflow/core/framework/op_kernel.cc:975] Invalid argument: Received a label value of 245 which is outside the valid range of [0, 10). Label values: 180 96 226 166 162 179 147 115 162 141 150 136 129 118 162 141 78 154 133 155 89 184 116 179 176 70 209 177 65 177 89 36 80 139 117 187 115 182 106 42 203 120 48 72 96 126 74 123 134 115 112 154 128 163 64 113 35 140 198 193 189 67 164 110 117 61 215 186 189 84 95 206 163 82 122 160 37 179 236 157 140 181 178 128 67 114 43 211 143 70 0 91 184 142 172 127 80 160 127 90 62 151 158 23 180 192 21 97 125 94 98 136 125 190 158 128 119 30 198 111 206 66 137 126 245 210 158 188

Traceback (most recent call last):

File "/Users/yangk/cifar10/cifar10_train.py", line 137, in

tf.app.run()

File "/Library/Python/2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run

sys.exit(main(sys.argv[:1] + flags_passthrough))

File "/Users/yangk/cifar10/cifar10_train.py", line 133, in main

train()

File "/Users/yangk/cifar10/cifar10_train.py", line 103, in train

_, loss_value = sess.run([train_op, loss])

File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 766, in run

run_metadata_ptr)

File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 964, in _run

feed_dict_string, options, run_metadata)

File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 1014, in _do_run

target_list, options, run_metadata)

File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 1034, in _do_call

raise type(e)(node_def, op, message)

tensorflow.python.framework.errors_impl.InvalidArgumentError: Received a label value of 245 which is outside the valid range of [0, 10). Label values: 180 96 226 166 162 179 147 115 162 141 150 136 129 118 162 141 78 154 133 155 89 184 116 179 176 70 209 177 65 177 89 36 80 139 117 187 115 182 106 42 203 120 48 72 96 126 74 123 134 115 112 154 128 163 64 113 35 140 198 193 189 67 164 110 117 61 215 186 189 84 95 206 163 82 122 160 37 179 236 157 140 181 178 128 67 114 43 211 143 70 0 91 184 142 172 127 80 160 127 90 62 151 158 23 180 192 21 97 125 94 98 136 125 190 158 128 119 30 198 111 206 66 137 126 245 210 158 188

[[Node: cross_entropy_per_example/cross_entropy_per_example = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT64, _device="/job:localhost/replica:0/task:0/cpu:0"](softmax_linear/softmax_linear, Cast_4)]]

Caused by op u'cross_entropy_per_example/cross_entropy_per_example', defined at:

File "/Users/yangk/cifar10/cifar10_train.py", line 137, in

tf.app.run()

File "/Library/Python/2.7/site-packages/tensorflow/python/platform/app.py", line 43, in run

sys.exit(main(sys.argv[:1] + flags_passthrough))

File "/Users/yangk/cifar10/cifar10_train.py", line 133, in main

train()

File "/Users/yangk/cifar10/cifar10_train.py", line 76, in train

loss = cifar10.loss(logits, labels)

File "/Users/yangk/cifar10/cifar10.py", line 289, in loss

logits, labels, name='cross_entropy_per_example')

File "/Library/Python/2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 1537, in sparse_softmax_cross_entropy_with_logits

precise_logits, labels, name=name)

File "/Library/Python/2.7/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 2378, in _sparse_softmax_cross_entropy_with_logits

features=features, labels=labels, name=name)

File "/Library/Python/2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op

op_def=op_def)

File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 2371, in create_op

original_op=self._default_original_op, op_def=op_def)

File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 1258, in init

self._traceback = _extract_stack()

InvalidArgumentError (see above for traceback): Received a label value of 245 which is outside the valid range of [0, 10). Label values: 180 96 226 166 162 179 147 115 162 141 150 136 129 118 162 141 78 154 133 155 89 184 116 179 176 70 209 177 65 177 89 36 80 139 117 187 115 182 106 42 203 120 48 72 96 126 74 123 134 115 112 154 128 163 64 113 35 140 198 193 189 67 164 110 117 61 215 186 189 84 95 206 163 82 122 160 37 179 236 157 140 181 178 128 67 114 43 211 143 70 0 91 184 142 172 127 80 160 127 90 62 151 158 23 180 192 21 97 125 94 98 136 125 190 158 128 119 30 198 111 206 66 137 126 245 210 158 188

[[Node: cross_entropy_per_example/cross_entropy_per_example = SparseSoftmaxCrossEntropyWithLogits[T=DT_FLOAT, Tlabels=DT_INT64, _device="/job:localhost/replica:0/task:0/cpu:0"](softmax_linear/softmax_linear, Cast_4)]]