title: Load pytorch model from different working directory
body: <p>I want to load and access a pretrained model from the directory outside where all files are saved. Here is how directory structure is:</p>
  
  <pre><code>-MyProject
  ----Model_checkpoint_and_scripts
  ------access_model.py
  --run_model.py
  --other files
  </code></pre>
  
  <p>When run model calls access_model.py it looks for model.py in current working directory and does not find it. As suggested <a href="https://stackoverflow.com/questions/42703500/best-way-to-save-a-trained-model-in-pytorch">here</a>, I could use</p>
  
  <pre><code>the_model = TheModelClass(*args, **kwargs)
  the_model.load_state_dict(torch.load(PATH))
  </code></pre>
  
  <p>But in this case what is a good way to save all the arguments to initialize the model? I am thinking to pickle the command line args but there are some arguments like vocab size which are calculated.</p>
  
  <p>Thanks</p>