PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.2k stars 5.58k forks source link

PaddlePaddle / MetaGym使用quadrotor环境出现AttributeError: 'ColorVisuals' object has no attribute 'crc' #47725

Open Marverlises opened 1 year ago

Marverlises commented 1 year ago

问题描述 Issue Description

在PaddlePaddle / MetaGym使用quadrotor环境安装后按照文档进行测试,出现AttributeError: 'ColorVisuals' object has no attribute 'crc',环境无法打开

版本&环境信息 Version & Environment Information


Paddle version: 2.2.0 Paddle With CUDA: False

OS: Windows 10 Python version: 3.7.13

CUDA version: None cuDNN version: None Nvidia driver version: 517.48

paddle-bot[bot] commented 1 year ago

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

LDOUBLEV commented 1 year ago

“geometry.crc()”代替“geometry.visual.crc()” 试试

Marverlises commented 1 year ago

你好谢谢你的帮助,但还是不行

原始的报错是: D:\Anaconda\envs\paddlepaddle\lib\site-packages\trimesh\parent.py:94: DeprecationWarning:geometry.md5()is deprecated and will be removed in October 2023: replace withgeometry.hash()orhash(geometry)` DeprecationWarning) Traceback (most recent call last): File "D:/Desktop/PARL_develop_examples_tutorials (1)/examples/parl2_dygraph_new/lesson5/homework/ddpg_quadrotor/train.py", line 184, in main() File "D:/Desktop/PARL_develop_examples_tutorials (1)/examples/parl2_dygraph_new/lesson5/homework/ddpg_quadrotor/train.py", line 163, in main agent, env, EVAL_EPISODES, render=True) File "D:/Desktop/PARL_develop_examples_tutorials (1)/examples/parl2_dygraph_new/lesson5/homework/ddpg_quadrotor/train.py", line 122, in run_evaluate_episodes env.render() File "D:/Desktop/PARL_develop_examples_tutorials (1)/examples/parl2_dygraph_new/lesson5/homework/ddpg_quadrotor/train.py", line 59, in render self.env.render() File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\env.py", line 169, in render z_offset=self.z_offset) File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\render.py", line 494, in init debug_mode=debug_mode) File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\render.py", line 117, in init self._initialize(init_drone_z) File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\render.py", line 130, in _initialize self._add_drone() File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\render.py", line 152, in _add_drone if geometry_hash(geom) == self.drone_vertex_list_hash: File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\utils.py", line 113, in geometry_hash md5 += str(geometry.visual.crc()) AttributeError: 'ColorVisuals' object has no attribute 'crc'

Process finished with exit code 1 现在改成geometry.crc()新的报错是 D:\Anaconda\envs\paddlepaddle\lib\site-packages\trimesh\parent.py:94: DeprecationWarning: geometry.md5() is deprecated and will be removed in October 2023: replace with geometry.__hash__() or hash(geometry) DeprecationWarning) D:\Anaconda\envs\paddlepaddle\lib\site-packages\trimesh\parent.py:58: DeprecationWarning: geometry.crc() is deprecated and will be removed in October 2023: replace with geometry.__hash__() or hash(geometry) DeprecationWarning) Traceback (most recent call last): File "D:/Desktop/PARL_develop_examples_tutorials (1)/examples/parl2_dygraph_new/lesson5/homework/ddpg_quadrotor/train.py", line 184, in main() File "D:/Desktop/PARL_develop_examples_tutorials (1)/examples/parl2_dygraph_new/lesson5/homework/ddpg_quadrotor/train.py", line 163, in main agent, env, EVAL_EPISODES, render=True) File "D:/Desktop/PARL_develop_examples_tutorials (1)/examples/parl2_dygraph_new/lesson5/homework/ddpg_quadrotor/train.py", line 122, in run_evaluate_episodes env.render() File "D:/Desktop/PARL_develop_examples_tutorials (1)/examples/parl2_dygraph_new/lesson5/homework/ddpg_quadrotor/train.py", line 59, in render self.env.render() File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\env.py", line 169, in render z_offset=self.z_offset) File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\render.py", line 494, in init debug_mode=debug_mode) File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\render.py", line 117, in init self._initialize(init_drone_z) File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\render.py", line 130, in _initialize self._add_drone() File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\render.py", line 152, in _add_drone if geometry_hash(geom) == self.drone_vertex_list_hash: File "D:\Anaconda\envs\paddlepaddle\lib\site-packages\rlschool\quadrotor\utils.py", line 113, in geometry_hash md5 += str(geometry.crc()) TypeError: unsupported operand type(s) for +=: 'int' and 'str'

Process finished with exit code 1 出错的代码片段: def geometry_hash(geometry): """ Get an MD5 for a geometry object

Parameters
------------
geometry : object

Returns
------------
MD5 : str
"""
if hasattr(geometry, 'md5'):
    # for most of our trimesh objects
    md5 = geometry.md5()
elif hasattr(geometry, 'tostring'):
    # for unwrapped ndarray objects
    md5 = str(hash(geometry.tostring()))

if hasattr(geometry, 'visual'):
    # if visual properties are defined
    **md5 += str(geometry.crc()) //修改后的,原始为geometry.visual.crc()**
return md5

`