The model file should be located in a folder that also contains the __init__.py file.
Let us create a folder named trainer that contains both the model file and the __init__ file:
mkdir trainercd trainer
The preceding code creates the trainer folder and changes directory to the newly-created folder.
Let us go ahead and create the model file as follows:
vim mnist_mlp_lr_numsteps.py
Insert the following code into the previously-created file:
from __future__ import print_functionimport argparseimport pickle from datetime import datetime import numpy as npfrom tensorflow.python.lib.io import file_io # for better file I/Oimport sysimport tensorflow as tfdef train_model(train_file='data/mnist.pkl',job_dir='./tmp/mnist_mlp', num_steps ...