Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about AttributeError: 'ColorVisuals' object has no attribute 'crc' #67

Open
Marverlises opened this issue Nov 7, 2022 · 4 comments
Open

Comments

@Marverlises
Copy link

When i use this to test the environment, it always send me the message that AttributeError: 'ColorVisuals' object has no attribute 'crc', So what's the reason, thanks!

@WorldEditors
Copy link
Collaborator

Can you show us the executing environment and detailed log?

@Marverlises
Copy link
Author

The original bug is:

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

The error fragment code is shown below:

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

My environment is :
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

@xueeinstein
Copy link
Collaborator

@thisisbaiy It looks like the new version of trimesh library uses different geometry APIs and raises this error. Please consider downgrading it and checking the compatibility.

@WorldEditors
Copy link
Collaborator

I found similar issues in #64
It can be solved by
pip install trimesh==3.2.39, colour==0.1.5

It can actually solved by
pip install metagym[quadrotor]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants