gym.wrappers.Monitor报错,无法使用
使用gym中的录制功能,报错,具体:
>>> import gym
>>> gym.wrappers.Monitor
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'gym.wrappers' has no attribute 'Monitor'
经过网上查询知道在gym的0.21以上版本API进行了更改,gym.wrappers.Monitor由
gym.wrappers.RecordVideo 和 gym.wrappers.RecordEpisodeStatistics 所替代:
注意,使用之前需要安装依赖:
pip install moviepy
import gym
env = gym.make("BipedalWalker-v3",render_mode = 'human') env = gym.wrappers.RecordEpisodeStatistics(env)
env = gym.wrappers.RecordVideo(env, f"videos/{gym.__version__}")
===================================================
关于gym.wrappers.RecordEpisodeStatistics的帮助文档:
class RecordEpisodeStatistics(gym.core.Wrapper)
| RecordEpisodeStatistics(*args, **kwds)
|
| This wrapper will keep track of cumulative rewards and episode lengths.
|
| At the end of an episode, the statistics of the episode will be added to ``info``
| using the key ``episode``. If using a vectorized environment also the key
| ``_episode`` is used which indicates whether the env at the respective index has
| the episode statistics.
|
| After the completion of an episode, ``info`` will look like this::
|
| >>> info = {
| ... ...
| ... "episode": {
| ... "r": "<cumulative reward>",
| ... "l": "<episode length>",
| ... "t": "<elapsed time since instantiation of wrapper>"
| ... },
| ... }
|
| For a vectorized environments the output will be in the form of::
|
| >>> infos = {
| ... ...
| ... "episode": {
| ... "r": "<array of cumulative reward>",
| ... "l": "<array of episode length>",
| ... "t": "<array of elapsed time since instantiation of wrapper>"
| ... },
| ... "_episode": "<boolean array of length num-envs>"
| ... }
|
| Moreover, the most recent rewards and episode lengths are stored in buffers that can be accessed via
| :attr:`wrapped_env.return_queue` and :attr:`wrapped_env.length_queue` respectively.
可以看到,gym.wrappers.RecordEpisodeStatistics 在运行过程中进行统计然后在info中进行显示,这样的操作会占用一定的计算资源,如果没有必要使用则不需要使用。
===================================================
参考:
https://zhuanlan.zhihu.com/p/569710619
gym.wrappers.Monitor报错,无法使用的更多相关文章
- 启动android monitor报错解决办法
再这汇总一下这段时间使用android monitor新遇到的问题,特汇总对应问题解决办法如下: 1.确保JDK和Android studio位数相同,比如JDK使用的是64位,studio也要是64 ...
- 烂泥:【解决】ubuntu使用远程NFS报错
本文由秀依林枫提供友情赞助,首发于烂泥行天下. 今天在ubuntu系统上使用远程NFS,发现一直报错无法使用. 查看NFS挂载命令没有错误,命令如下: mount -t nfs 192.168.1.1 ...
- (转) 关于Oracle EBS邮件服务无法使用的报错
来源http://blog.itpub.net/23850820/viewspace-1060596/ 也可以检查如下网站:http://blog.sina.com.cn/s/blog_5b021b4 ...
- LoadRunner监控windows资源报错Monitor name :Windows Resources. Cannot connect to machine
目标机:被监控的机器,windows server 2008 R2. 测试机:执行control的机器,windows7 操作:在测试机上执行Control,添加windows的监控 问题现象:Mon ...
- ORA-15025 搭建DG环境,restore controlfile报错,提示oracle无法使用ASM存储
环境说明: #主库RAC环境 #备库RAC环境,操作系统AIX 6.1 数据库版本11.2.0.3 报错说明: #主库备份控制文件,传输至备库,备库restore 报错 本篇文档,分为两大阶段:第一阶 ...
- Django_重装系统后无法使用 sqlite 数据库报错:com.intellij.execution.ExecutionException: Exception in thread "main" java.lang.ClassNotFoundException: org.sqlite.JDBC
重装系统后无法使用 sqlite 数据库报错 报错 : com.intellij.execution.ExecutionException: Exception in thread "ma ...
- Apache报错:无法使用可靠的服务器域名
Apache 安装和启动时报错:无法使用可靠的服务器域名,打开Apache配置文件httpd.conf,去除 ServerName 前面的注释即可 1. 报错信息:无法使用可靠的服务器域名 AH005 ...
- 关于android sdk中monitor.exe报错的问题
今天又是被坑的一上午.来总结一下: 1. 首先是找不到monitor的问题: 这个可能是一开始环境配置错误.所以我将android sdk重装了一下就好了 2. 第二个是找到monitor.bat发现 ...
- Kvm:启动报错:error: internal error: process exited while connecting to monitor: 2018-11-12T01:47:14.993371Z qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory
今天有台kvm挂了,物理机启动时报错 很明显看报错显示内存不足,无法分配内存,查看物理机内存使用正常,.xml修改虚机内存后启动依然报错 报错: 这时候需要看一下主机确保可以分配多少内存 sysctl ...
- 发布报错:Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store
发布报错:Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store 昨晚上传项目到AppStore,报了这个错,纳尼! ...
随机推荐
- Spring扩展——Aware接口
Aware接口 在Spring中有许多的Aware接口,提供给应用开发者使用,通过Aware接口,我们可以通过set的方式拿到我们需要的bean对象(包括容器中提供的一些对象,ApplicationC ...
- linux查看端口命令 lsof netstat
[root@VM-4-3-centos /]# lsof -i:8881COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEnode 15526 roo ...
- Docker中部署单机Redis详细教程
1.拉取Redis镜像 # 拉取redis镜像,不指定版本则默认是最新版本 docker pull redis 2.查看镜像 # 列出本地镜像 docker images 3.准备配置文件路径 # 创 ...
- 初学者必读:如何使用 Nuxt 中间件简化网站开发
title: 初学者必读:如何使用 Nuxt 中间件简化网站开发 date: 2024/6/24 updated: 2024/6/24 author: cmdragon excerpt: 本文概述了N ...
- 集成学习与随机森林(二)Bagging与Pasting
Bagging 与Pasting 我们之前提到过,其中一个获取一组不同分类器的方法是使用完全不同的训练算法.另一个方法是为每个预测器使用同样的训练算法,但是在训练集的不同的随机子集上进行训练.在数据抽 ...
- Linux gpio子系统:gpio_direction_output 与 gpio_set_value的区别
Linux gpio子系统:gpio_direction_output 与 gpio_set_value的区别 背景 最近改驱动程序,看到驱动代码中既有gpio_direction_output也有g ...
- Filter拦截器从入门到快速上手与Listener监听器概述
前置内容: 会话跟踪技术 目录 1. 过滤器Filter 1.1 Filter快速入门 1.2 Filter执行流程 1.3 Filter使用细节 1.4 案例 2. 监听器Listener概述 2. ...
- 详解Web应用安全系列(9)点击劫持
点击劫持(Clickjacking)漏洞,也被称为界面伪装攻击(UI Redress Attack)或UI覆盖攻击,是一种利用视觉欺骗手段进行的网络攻击方式.这种攻击方式通过技术手段欺骗用户点击他们本 ...
- CF620E
题目 CF620E 思路 这个题是一个在树上操作的题,每次操作的对象都是以一个结点为根的子树,在1e5的操作下暴力做法必然会超时 观察到c的范围很小,可以考虑状态压缩 考虑将此问题转化为区间问题,利用 ...
- 全网最适合入门的面向对象编程教程:02 类和对象的Python实现-使用Python创建类
全网最适合入门的面向对象编程教程:02 类和对象的 Python 实现-使用 Python 创建类 摘要 本文主要介绍了串口通信协议的基本概念.串口通信的基本流程.如何使用 Python 语言创建一个 ...