gpt4 book ai didi

python - 版本控制的 Tensorflow textsum 错误

转载 作者:太空宇宙 更新时间:2023-11-03 15:03:35 32 4
gpt4 key购买 nike

我正在尝试将训练文本文件转换为bin文件以训练tensorflow的textsum。但我遇到了以下错误:

$ python textsum/data_convert_example.py --command text_to_binary --in_file data/tt.txt --out_file data/bin_data_train
Traceback (most recent call last):
File "textsum/data_convert_example.py", line 12, in <module>
import tensorflow as tf
File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 104, in <module>
from tensorflow.python.platform import test
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/test.py", line 57, in <module>
import mock # pylint: disable=g-import-not-at-top,unused-import
File "/usr/local/lib/python2.7/dist-packages/mock/__init__.py", line 2, in <module>
import mock.mock as _mock
File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 71, in <module>
_v = VersionInfo('mock').semantic_version()
File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 461, in semantic_version
self._semantic = self._get_version_from_pkg_resources()
File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 448, in _get_version_from_pkg_resources
result_string = packaging.get_version(self.package)
File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 755, in get_version
name=package_name))
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.

请帮助我。我使用的是tensorflow 1.2.0和python 2.7.2。

最佳答案

您的安装肯定有问题。

请尝试以下命令:


pip install --升级模拟
pip install --升级分发

如果它不起作用,您应该向我们提供有关如何安装tensorflow(pip?conda?clone&setup.py?)的更多详细信息,并尝试从头开始重新安装。

希望对你有帮助

关于python - 版本控制的 Tensorflow textsum 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44858973/

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