1

我已经从这个链接安装了模块 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'

4

2 回答 2

1

以下为我解决了这个问题:

  1. pip 卸载 onnx-tf
  2. pip install git+https://github.com/onnx/onnx-tensorflow.git
  3. 点安装张量流插件

(使用 TensorFlow 2.3 和 Python 3.8)

于 2020-11-18T02:17:29.867 回答
1

检查您的张量流版本

pip show tensorflow

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

pip install tensorflow-gpu==1.14

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

pip install tensorflow==1.14
于 2020-01-19T20:32:50.910 回答