import tensorflow as tf

        do_nothing = np.zeros(self.ACTIONS)
        do_nothing[0]=1
        x_t,r_0,terminal =self.game_state.frame_step(do_nothing)
        x_t = cv2.cvtColor(cv2.resize(x_t,(80,80)),cv2.COLOR_BGR2GRAY)
        ret,x_t = cv2.threshold(x_t,1,255,cv2.THRESH_BINARY)
        s_t = np.stack((x_t,x_t,x_t,x_t),axis=2)
        return s_t



    def restore_param(self):
        Saver = tf.train.Saver()
        self.sess.run(tf.global_variables_initializer())
        checkpoint = tf.train.get_checkpoint_state("saved_networks")
        if checkpoint and checkpoint.model_checkpoint_path:
            Saver.restore(self.sess,checkpoint.model_checkpoint_path)
            print("Successfully loaded",checkpoint.model_checkpoint_path)
        else:
            print("Could not find old network weights")

        return Saver


    # 定义一个weight，其中命名空间为name，形状为shape
