摘要: @abstractmethod 经常在函数定义的之前出现,它的意思是,当前函数的定义是固定的,继承该函数时无法修改其内容。 阅读全文
posted @ 2021-09-19 14:08 呦呦南山 阅读(45) 评论(0) 推荐(0) 编辑
摘要: def load_data_from_gfootball(args): data_path = "/home/longfei-fwxz/offline-rl/offline/datasets/gfootball/data/0890.pkl" print("args:",args) # envs = 阅读全文
posted @ 2021-09-18 17:47 呦呦南山 阅读(81) 评论(0) 推荐(0) 编辑
摘要: (data["next_obs"][i] != data["obs"][i+1]).all() 用.all()即可 阅读全文
posted @ 2021-09-18 17:38 呦呦南山 阅读(161) 评论(0) 推荐(0) 编辑
摘要: import osimport sysfrom pathlib import Pathsys.path.append("..")current_dir = os.path.abspath(os.path.dirname(__file__))parent_path = os.path.dirname( 阅读全文
posted @ 2021-09-18 00:07 呦呦南山 阅读(24) 评论(0) 推荐(0) 编辑
摘要: src0 = torch.tensor([[ 0.], [1.], [2.], [3.], [4.], [5.], [1.], [2.], [3.], [3.], [0.], [1.], [4.]]) src = np.array(src0).squeeze() torch.eye(6)[src,: 阅读全文
posted @ 2021-09-17 01:14 呦呦南山 阅读(23) 评论(0) 推荐(0) 编辑
摘要: render设置为false则可以避免在训练时渲染,节省时间和资源。 一般都是在超参数设置,但有时也直接在环境定义的时候修改,注意要根据具体情况来定。 比如: need_render = (rank == 0) and not isEval self.env = football_env.creat 阅读全文
posted @ 2021-09-15 12:10 呦呦南山 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 在代码中设置指定GPU,代码仍旧运行不成功 device = torch.device(“cuda:3” if torch.cuda.is_available() else “cpu”)model = model.to(device) 在上面的代码前面添加了代码torch.cuda.set_devi 阅读全文
posted @ 2021-09-14 23:21 呦呦南山 阅读(3739) 评论(2) 推荐(1) 编辑
摘要: CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing 阅读全文
posted @ 2021-09-14 21:24 呦呦南山 阅读(15991) 评论(0) 推荐(1) 编辑
摘要: 安装: pip install tmux 常用指令及快捷键: 查看所有的tmux会话:tmux ls ,快捷键 ctrl + b s 新建设tmux窗口: tmux new -s <session-name> 重命名会话: tmux rename-session -t <old-name> <new 阅读全文
posted @ 2021-09-09 12:22 呦呦南山 阅读(2690) 评论(0) 推荐(0) 编辑
摘要: import pdb pdb.set_trace() 阅读全文
posted @ 2021-09-01 16:33 呦呦南山 阅读(32) 评论(0) 推荐(0) 编辑