我通过tensorflow
在我的arch linux计算机上安装了pacman
。我试图运行官方example code来解决mnist问题,但是我收到了这个错误:
Traceback (most recent call last):
File "mnist_example.py", line 27, in <module>
from tensorflow.examples.tutorials.mnist import input_data
File "/usr/lib/python3.6/site-packages/tensorflow/examples/tutorials/mnist/__init__.py", line 21, in <module>
from tensorflow.examples.tutorials.mnist import input_data
File "/usr/lib/python3.6/site-packages/tensorflow/examples/tutorials/mnist/input_data.py", line 29, in <module>
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/__init__.py", line 38, in <module>
from tensorflow.contrib import keras
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/keras/__init__.py", line 26, in <module>
from tensorflow.contrib.keras.api.keras import *
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/keras/api/keras/__init__.py", line 25, in <module>
from tensorflow.contrib.keras.api.keras import activations
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/keras/api/keras/activations/__init__.py", line 22, in <module>
from tensorflow.contrib.keras.python.keras.activations import elu
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/keras/python/keras/__init__.py", line 21, in <module>
from tensorflow.contrib.keras.python.keras import activations
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/keras/python/keras/activations.py", line 24, in <module>
from tensorflow.contrib.keras.python.keras.engine import Layer
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/keras/python/keras/engine/__init__.py", line 26, in <module>
from tensorflow.contrib.keras.python.keras.engine.training import Model
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/keras/python/keras/engine/training.py", line 28, in <module>
from tensorflow.contrib.keras.python.keras import callbacks as cbks
File "/usr/lib/python3.6/site-packages/tensorflow/contrib/keras/python/keras/callbacks.py", line 34, in <module>
from tensorflow.contrib.tensorboard.plugins import projector
ModuleNotFoundError: No module named 'tensorflow.contrib.tensorboard'
我找不到tensorboard
文件夹,因此找不到projector
文件夹中请求的tensorflow/contrib/
模块。你知道我怎么能解决这个问题吗?
答案 0 :(得分:0)
作为脏黑客,您可以下载相应的Pip存档并将存档中的contrib/tensorboard
目录复制到/usr/lib/python3.6/site-packages/tensorflow/contrib/tensorboard
。