导入tensorpack记录器错误

时间:2018-01-24 11:10:55

标签: python tensorflow

导入tensorpack的记录器会出现以下错误:

>>> from tensorpack import logger
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/wangtao/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorpack/__init__.py", line 10, in <module>
    from tensorpack.dataflow import *
  File "/home/wangtao/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorpack/dataflow/__init__.py", line 33, in <module>
    _global_import(module_name)
  File "/home/wangtao/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorpack/dataflow/__init__.py", line 14, in _global_import
    p = __import__(name, globals(), locals(), level=1)
  File "/home/wangtao/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorpack/dataflow/parallel.py", line 424, in <module>
    PlasmaPutData = create_dummy_class('PlasmaPutData', 'pyarrow')   # noqa
NameError: name 'create_dummy_class' is not defined

有人知道如何解决它吗?

1 个答案:

答案 0 :(得分:0)

tensorpack/tensorpack/dataflow/parallel.中有一些行 虽然我不知道这些行的目的是什么,但我知道我错过了pyarrow包,pip install pyarrow解决了问题

try:
    import pyarrow.plasma as plasma
except ImportError:
    PlasmaPutData = create_dummy_class('PlasmaPutData', 'pyarrow')   # noqa
    PlasmaGetData = create_dummy_class('PlasmaGetData', 'pyarrow')   # noqa