没有名为tensorflow.python.platform的模块

2024-04-25 14:19:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在运行tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py。我得到:

hiro106@hiro106-virtual-machine:~$ python tensorflow/tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py
Traceback (most recent call last):
File "tensorflow/tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py", line 33, in 
import tensorflow.python.platform
ImportError: No module named tensorflow.python.platform

Tags: pymosttensorflowfeedvirtualmachinemnistplatform
2条回答

import tensorflow在Python shell中工作吗?

如果没有,请尝试使用pip install --upgrade --force-reinstall <package>重新安装。

例如,对于支持GPU的TensorFlow版本1.12:pip install --upgrade --force-reinstall tensorflow-gpu==1.12.0

试试这个,它对我有效:

sudo pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl

相关问题 更多 >