我正在研究图像分类模型,使用 RandomForestClassifier 创建模型,使用 TensorFlow 创建训练模型层。我的数据集仅包含 jpg 图像,一切都很好,直到我运行此代码
train_rfc=feature_extractor.predict(train_ds)
rf_model=rfc(n_estimators=100,random_state=42)
rf_model.fit(train_rfc,train_en_label)
执行此操作后我得到了
---------------------------------------------------------------------------
InvalidArgumentError Traceback (most recent call last)
<ipython-input-17-6b7f83954d85> in <module>()
----> 1 train_rfc=feature_extractor.predict(train_ds)
2 rf_model=rfc(n_estimators=100,random_state=42)
3 rf_model.fit(train_rfc,train_en_label)
6 frames
/usr/local/lib/python3.7/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: jpeg::Uncompress failed. Invalid JPEG data or crop window.
[[{{node decode_image/DecodeImage}}]]
[[IteratorGetNext]] [Op:__inference_predict_function_247]
Function call stack:
predict_function
谁能建议我必须在输入管道中进行哪些更改。