tensorflow - 属性错误: 'module' object has no attribute 'ceil'

标签 tensorflow pip installation onnx

我已经从这个 link 安装了 onnx_tf 模块.

之后,当我验证安装为 python -c "import onnx_tf" 时,我遇到了以下错误。我该如何解决?谢谢

testuser@testuser:~$ python -c "import onnx_tf"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/testuser/.local/lib/python2.7/site-packages/onnx_tf/__init__.py", line 1, in <module>
    from . import frontend
  File "/home/testuser/.local/lib/python2.7/site-packages/onnx_tf/frontend.py", line 18, in <module>
    from onnx_tf.common.handler_helper import get_all_frontend_handlers
  File "/home/testuser/.local/lib/python2.7/site-packages/onnx_tf/common/handler_helper.py", line 5, in <module>
    from onnx_tf.handlers.backend import *  # noqa
  File "/home/testuser/.local/lib/python2.7/site-packages/onnx_tf/handlers/backend/ceil.py", line 10, in <module>
    @tf_func(tf.ceil)
AttributeError: 'module' object has no attribute 'ceil'

最佳答案

检查您的 tensorflow 版本

pip show tensorflow

如果是2.x,您可能需要更改为旧版本。

pip install tensorflow-gpu==1.14

或者如果您使用的是CPU...

pip install tensorflow==1.14

关于tensorflow - 属性错误: 'module' object has no attribute 'ceil' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55573383/

相关文章:

tensorflow - 如何从 AttentionWrapper 可视化注意力权重

tensorflow - 在 Keras Tensorflow 中加入两个同名模型

使用 wheel 文件的 python Pip 安装不起作用

pip - 从 Travis CI 部署 PyPi : Invalid or non-existent authentication

centos - 如何在centos上安装mke2fs?

python - 无法在 tensorflow 中训练玩具 LSTM

python - Tensorflow CPU(在 python 交互式 shell 中正常,但运行脚本时出现 coredump)

python - 使用 pip install 安装 scipy 时出现错误消息

testing - TeamCity - 使用 JUnit 进行测试

python-3.x - 如何在python=3.6中安装torch==0.3.1