导出tfrecord时是正常的,
take的时候就报错了,
图片做了resize呀
Traceback (most recent call last):
File "train_simple.py", line 121, in <module>
train()
File "train_simple.py", line 49, in train
for data in train_dataset.take(2):
File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 747, in __next__
return self._next_internal()
File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/data/ops/iterator_ops.py", line 739, in _next_internal
return structure.from_compatible_tensor_list(self._element_spec, ret)
File "/usr/lib64/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/eager/context.py", line 2116, in execution_mode
executor_new.wait()
File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/eager/executor.py", line 69, in wait
pywrap_tfe.TFE_ExecutorWaitForAllPendingNodes(self._handle)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 12288 values, but the requested shape has 4096
[[{{node Reshape}}]]
resize取域:
# print(img.tobytes())
img = cv2.resize(img, (64, 64))
w = img.shape[0]
h = img.shape[1]
# cv2.imshow('', img)
求大佬帮助!