Tensorflow 没有名为官方的模块 [英] Tensorflow no module named official
问题描述
我正在尝试使用 tensorflows 模型存储库的官方 mnist 目录中的网络.在我的 Windows 系统上,我收到此错误:
I am trying to use the nets from the official mnist directory of tensorflows model repository. On my windows system I receive this error:
C:\Users\ry\Desktop\NNTesting\models\official\mnist>mnist_test.py
Traceback (most recent call last):
File "C:\Users\ry\Desktop\NNTesting\models\official\mnist\mnist_test.py",line 24, in <module>
from official.mnist import mnist
ModuleNotFoundError: No module named 'official'
我遵循了他们的官方指示并设置我的python路径使用
I have followed their official directions and set my python path using
set PYTHONPATH="PYTHONPATH:"%cd%"
并且可以确认
PYTHONPATH="$PYTHONPATH:C:\Users\ry\Desktop\NNTesting\models"
而且我也成功安装了依赖项.有没有人有在 Windows 系统上使用这些模型的经验,可以帮助我解决这个路径问题吗?我不确定我在这里做错了什么.
and I have also installed the dependencies successfully. Does anyone have experience using these models on a windows system and can help me with this pathing issue? I'm not sure what I have done incorrectly here.
谢谢
推荐答案
如果有人遇到这个问题,请确保 python 路径变量中没有引号.出于某种原因,自述文件周围有引文.
if anyone has this problem make sure that the python path variable doesn't have quotations in it. For some reason, the readme has quotations around it.
这里是正确的设置方法
PYTHONPATH=path\to\models
这篇关于Tensorflow 没有名为官方的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!