google-colaboratory - Google Colabs 中的 TensorFlow 2 在模型测试中失败了预处理错误
问题描述
我试图在我的完整模型上调用 predict() 并将其传递给测试数据批次。该模型适用于我的训练和验证数据,但是当我尝试在我的测试数据上运行它时出现此错误。
我已经查看了堆栈溢出链接上的答案,但我无法就为什么我不断收到错误建立联系。
这是我运行的功能:
# Make predictions on test data batch using the loaded full model
test_predictions = loaded_full_model.predict(test_data,
verbose=1)
这是返回的错误:
14/324 [>.............................] - ETA: 39s
---------------------------------------------------------------------------
FailedPreconditionError Traceback (most recent call last)
<ipython-input-98-1081792ff13f> in <module>()
1 # Make predictions on test data batch using the loaded full model
2 test_predictions = loaded_full_model.predict(test_data,
----> 3 verbose=1)
8 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:
FailedPreconditionError: 2 root error(s) found.
(0) Failed precondition: /content/drive/My Drive/Colab Notebooks/test/.ipynb_checkpoints; Is a
directory
[[{{node ReadFile}}]]
[[IteratorGetNext]]
[[IteratorGetNext/_2]]
(1) Failed precondition: /content/drive/My Drive/Colab Notebooks/test/.ipynb_checkpoints; Is a
directory
[[{{node ReadFile}}]]
[[IteratorGetNext]]
0 successful operations.
0 derived errors ignored. [Op:__inference_predict_function_189545]
Function call stack:
predict_function -> predict_function
解决方案
推荐阅读
- python - 更改新创建的谷歌电子表格的默认共享
- reactjs - 如何在第一次渲染之前在 React 函数组件中运行代码,例如在类组件的构造函数中?
- flutter - Flutter 自定义形状按钮小部件
- c++ - 如何从另一个类模板中专门化一个类模板?
- python - 如何使用 tkinter 将变量作为参数传递给 python 中的方法
- r - 为什么 R 文档指出可能出现大于最大归一化浮点数的数字?
- java - onBindViewHolder 在 android studio java 中不起作用
- jenkins - 从 Appcenter 触发 Jenkins 作业
- terminal - Scrapy shell 终端有一个 emacs 扩展,可以自动完成我的命令
- arrays - PowerShell - 从数组中删除项目