class EpsilonGreedyAgent(object):

    def __init__(self, actions_num):
        self.actions_num = actions_num
    
    def _get_state_value(self, state, model):
        state = np.expand_dims(state, 0)
        state = Variable(torch.from_numpy(state), volatile=False)
        if use_cuda:
            state = state.cuda()
        return model(state).data.cpu().numpy()

    def __call__(self, state, model, eps):
        state_value = self._get_state_value(state, model)
        sample = random.random()

        if sample > eps:
            action = np.argmax(state_value)
        else:
            action = random.randrange(self.actions_num)
        return action

I found my mistake. I didn’t use all wrappers for environment when I was testing model.