I recently trained an LSTM model to do sequence classification. Earlier I was getting pretty good accuracy, but now when I load the saved model and run it on the same train and test set it consistently gives me the same output no matter what class. It also gives me a SourceChangeWarning and suggests me to use torch.nn.Module.dump_patch = True, which I did and I got a .patch file, but when  I run patch -p0 < lstm.patch it isnt able to find it.
The definition of the lstm class is here -

  
      github.com
  
  
    gtm2122/viewclassification/blob/master/view_testls/LSTM_view/lstm_class.py 1
import torch
from torch.autograd import Variable
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
import scipy.misc
import torch.optim as optim
import torch.nn.functional as F

import random

### This script is essentially the neural network architecture along with wrappers for training and testing

class lstm_proc(nn.Module):
	def __init__(self,window_len=0,data_dir=0,cache_dir=0,overwrite=0,epochs=10,hidden_dim = 1000,num_views=15,embed_sz=19872,layers=1,dropout = 0):
		super(lstm_proc,self).__init__()
		self.epochs=epochs
		self.window_len = window_len
		self.cache_dir = cache_dir
		self.hidden_dim=hidden_dim


  This file has been truncated. show original

  
  
    
    
  
  


When I run patch -p0 < lstm_proc.patch it says “cant find file at input line 3” Perhaps you used the wrong -p
The wrapper file that I use to load the model is https://github.com/gtm2122/viewclassification/blob/master/view_testls/LSTM_view/test_wrap.py 4