Tensorflow no module named official

Issue

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'

I have followed their official directions and set my python path using

set PYTHONPATH="PYTHONPATH:"%cd%"

and can confirm that

PYTHONPATH="$PYTHONPATH:C:\Users\ry\Desktop\NNTesting\models"

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.

Thanks

Solution

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.

Here is the correct way to set it

PYTHONPATH=path\to\models

Answered By – Ryan Brady

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published