1

我确保我的数据集包含 jpeg 格式的所有图像。我在某个地方读到了使用tf.image.decode_jpeg(),但即使所有文件都是 jpeg 格式,我仍然需要它。如果是,该怎么做?

InvalidArgumentError                      Traceback (most recent call last)
<ipython-input-29-c6c91b75df2e> in <module>()
----> 1 model = image_classifier.create(train_data)

11 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     58     ctx.ensure_initialized()
     59     tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
---> 60                                         inputs, attrs, num_outputs)
     61   except core._NotOkStatusException as e:
     62     if name is not None:

InvalidArgumentError: 2 root error(s) found.
  (0) Invalid argument:  Unknown image file format. One of JPEG, PNG, GIF, BMP required.
     [[{{node cond/else/_1/cond/DecodePng}}]]
     [[IteratorGetNext]]
  (1) Invalid argument:  Unknown image file format. One of JPEG, PNG, GIF, BMP required.
     [[{{node cond/else/_1/cond/DecodePng}}]]
     [[IteratorGetNext]]
     [[IteratorGetNext/_2]]
0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_23384]

Function call stack:
train_function -> train_function
4

0 回答 0