python - TypeError:无法将符号 Keras 输入/输出转换为 google colab 上的 numpy 数组
问题描述
我正在尝试使用 google colab运行此代码文件。虽然我得到了一些输出,但出现了一个错误,我不太明白为什么会出现这个错误。
TypeError: Cannot convert a symbolic Keras input/output to a NumPy array. This error may indicate that you're trying to pass a symbolic value to a NumPy call, which is not supported. Or, you may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model.
我在堆栈溢出时查看了这个问题,发现其他用户之前发布的几个相同的问题,但我认为我没有找到任何与我的代码相关的答案。请帮助我了解代码有什么问题以及如何解决?我对 TensorFlow 完全陌生。
注意:我会在这里粘贴整个代码,但它是一个超过 1400 行的代码,所以我直接超链接了文件,因为人们可能会生气,此外,这样做会变得很长。但如果需要,我可以编辑帖子并将整个代码粘贴到此处。
解决方案
推荐阅读
- python - Python C API - 在主线程中运行所有 python 线程(或伪造它)
- cuda - 就地减少CUDA(CUB /推力)的总和?
- multithreading - 多客户端视频 tcp 流英特尔 realsense
- python - 当 python 类 jitclass 包含自己的 jitclass 类时,如何使它兼容?
- azure - 如何以安全的方式从 Unity 移动应用访问 Azure 存储 Blob
- c# - 为什么传递字符串不起作用,即使字符串在函数中作为引用传递?
- c# - 在 docker run 上找不到 appsettings.json 文件的问题
- python-3.x - 创建图形时禁止绘图窗口
- python - 正确的数据加载器设置以训练更快的 rcnn-resnet50 以使用 pytorch 进行对象检测
- image-processing - 医学图像分割需要像素值归一化吗?