gpt4 book ai didi

python - 属性错误 : 'gevent._local.local' object has no attribute 'value'

转载 作者:太空宇宙 更新时间:2023-11-04 04:02:19 28 4
gpt4 key购买 nike

我有一个 keras Sequential 模型,它在模型训练期间运行得非常好,但是当我尝试在训练模型上运行 model.predict 命令时,

我收到以下错误:-

Traceback (most recent call last):
File "/opt/program/predictor.py", line 69, in predict
a=model.predict(x_input, verbose=0)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 1456, in predict
self._make_predict_function()
File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 378, in _make_predict_function
**kwargs)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/network.py", line 323, in __setattr__
super(Network, self).__setattr__(name, value)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/base_layer.py", line 1215, in __setattr__
if not _DISABLE_TRACKING.value:
File "src/gevent/local.py", line 408, in gevent._local.local.__getattribute__

AttributeError: 'gevent._local.local' object has no attribute 'value'

我已经搜索过这个错误,但找不到任何解决方案。有谁知道解决这个问题的办法吗?

最佳答案

我得到了这个错误的原因:

我的 docker 容器自动安装最新的 keras 版本,该版本已更改为 2.3.0(新的稳定版本),直到上周才可用,因此我的容器之前运行良好。 Keras 新的稳定版本:2.3.0 可能与导致此冲突的 Gevent 存在一些问题。

我卸载了 keras 并安装了 2.2.5 版本解决了错误。

pip uninstall keras
pip install keras==2.2.5

关于python - 属性错误 : 'gevent._local.local' object has no attribute 'value' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58018009/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com