carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.11k stars 3.58k forks source link

ValueError: role_name: colors must have 3 channels (R,G,B) #8035

Open ssingh17j opened 1 month ago

ssingh17j commented 1 month ago

Carla version: 0.9.15 OS: Windows 11 Pro

Problem experienced: When I try to run the example files in carla/PythonAPI/examples, I get the following error:

(carla-sim) D:\carla\PythonAPI\examples>python lidar_to_camera.py
WARNING: Version mismatch detected: You are trying to connect to a simulator that might be incompatible with this API
WARNING: Client API version     = 0.9.15
WARNING: Simulator API version  = 0.9.15-230-g1ef3f55c9-dirty
INFO:  Found the required file in cache!  Carla/Maps/Nav/Town10HD_Opt.bin
ERROR: invalid color autopilot
Traceback (most recent call last):
  File "lidar_to_camera.py", line 354, in <module>
    main()
  File "lidar_to_camera.py", line 346, in main
    tutorial(args)
  File "lidar_to_camera.py", line 62, in tutorial
    bp_lib = world.get_blueprint_library()
ValueError: role_name: colors must have 3 channels (R,G,B) 

I am getting this same error, when I try to run any files involving car and human examples.

I have also noticed that the carla\PythonAPI\docs\snipets\carla.ActorBlueprint.set_attribute.py file has a mistake in line 10 of the code: vehicle_bp = wolrd.get_blueprint_library().filter('vehicle.bmw.*')

Also, the D:\carla\PythonAPI\docs\blueprint.yml file uses Color in line 18. Should this be color?

I am not sure if the above things are the source of the problem, but I am letting you know.

I have found a similar issue at https://github.com/carla-simulator/carla/issues/7981, but it has not been resolved, so I am raising a new issue.

Thank you

Nithin-Supani commented 1 month ago

I am facing the same problem. but in this solution from this issue #7939.

They found a temporary solution to roll back "git reset --hard "4da0c74", then rebuild PythonAPI and make launch. But this solved the error "ValueError: role_name: colors must have 3 channels (R,G,B)"

i am getting new error when i try to spawn a camera and attach it to the vehicle:

53 camera_init_trans = carla.Transform(carla.Location(z=CAMERA_POS_Z,x=CAMERA_POS_X)) 54 #this creates the camera in the sim ---> 55 camera = world.spawn_actor(camera_bp,camera_init_trans,attach_to=vehicle) 57 def camera_callback(image,data_dict): 58 data_dict['image'] = np.reshape(np.copy(image.raw_data),(image.height,image.width,4))

RuntimeError: rpc::rpc_error during call in function spawn_actor_with_parent

This is the same case if i run any generate_traffic.py:

python generate_traffic.py WARNING: Version mismatch detected: You are trying to connect to a simulator that might be incompatible with this API WARNING: Client API version = 0.9.15 WARNING: Simulator API version = 0.9.15-221-g4da0c7415-dirty

destroying 0 vehicles

destroying 0 walkers

done. Traceback (most recent call last): File "/home/milab/carla/PythonAPI/examples/generate_traffic.py", line 374, in main() File "/home/milab/carla/PythonAPI/examples/generate_traffic.py", line 247, in main for response in client.apply_batch_sync(batch, synchronous_master): RuntimeError: rpc::rpc_error during call in function apply_batch

stavtant commented 1 month ago

Windows 10 Pro GeForce RTX 4060 carla 0.9.15 UE4

I face the same issue (ValueError: role_name: colors must have 3 channels (R,G,B)) when i try to run scripts after importing a vehicle which I made via Blender. The strange thing is that only the dynamic weather is working. I tried switching python versions but it didn't work. When I delete the vehicle which I made, from CarlaUE4 editor, the error I'm facing is:

WARNING: Version mismatch detected: You are trying to connect to a simulator that might be incompatible with this API WARNING: Client API version = 0.9.15 WARNING: Simulator API version = 0.9.15-221-g4da0c7415-dirty INFO: Found the required file in cache! Carla/Maps/Nav/Town10HD_Opt.bin INFO: Found the required file in cache! Carla/Maps/TM/Town10HD_Opt.bin

destroying 0 vehicles destroying 0 walkers

done. Traceback (most recent call last): File "C:\carla\PythonAPI\examples\generate_traffic.py", line 379, in main() File "C:\carla\PythonAPI\examples\generate_traffic.py", line 247, in main for response in client.apply_batch_sync(batch, synchronous_master): RuntimeError: rpc::rpc_error during call in function apply_batch

Any ideas?

ssingh17j commented 1 month ago

I am getting the exact same error after using the above temporary solution given by @Nithin-Supani

WARNING: Client API version = 0.9.15
WARNING: Simulator API version = 0.9.15-221-g4da0c7415-dirty
INFO: Found the required file in cache! Carla/Maps/Nav/Town10HD_Opt.bin
INFO: Found the required file in cache! Carla/Maps/TM/Town10HD_Opt.bin

destroying 0 vehicles
destroying 0 walkers

done.
Traceback (most recent call last):
File "C:\carla\PythonAPI\examples\generate_traffic.py", line 379, in
main()
File "C:\carla\PythonAPI\examples\generate_traffic.py", line 247, in main
for response in client.apply_batch_sync(batch, synchronous_master):
RuntimeError: rpc::rpc_error during call in function apply_batch 

In a carla github issue section I found a temporary resolution , to reinstall the PythonAPI using make command. Even after following the steps I got the same error, hence no resolution

Turuu1124 commented 1 month ago

i have the same issue, so did we all mess up when downloading carla from source or is it carla's fault? any idea on how to fix this?

stavtant commented 3 weeks ago

**A mini update, i find out that on PythonAPI folder there is no dist folder which should contain the .egg or .whl file. I tried again the make PythonAPI command and nothing changed although on prompt the output was: Carla lib for python has been successfully installed in "C:\carla\PythonAPI\carla\dist". Anyone know why?

stavtant commented 2 weeks ago

SOLUTION!! Follow these steps. In a terminal: git fetch --all --tags git checkout 0.9.15

In x64 native tools prompt: make PythonAPI make launch

leeilju commented 2 weeks ago

SOLUTION!! Follow these steps. In a terminal: git fetch --all --tags git checkout 0.9.15

In x64 native tools prompt: make PythonAPI make launch

this made my carla not working.. ㅜㅡㅜ

stavtant commented 2 weeks ago

SOLUTION!! Follow these steps. In a terminal: git fetch --all --tags git checkout 0.9.15 In x64 native tools prompt: make PythonAPI make launch

this made my carla not working.. ㅜㅡㅜ

But mine made it work :)

leeilju commented 2 weeks ago

SOLUTION!! Follow these steps. In a terminal: git fetch --all --tags git checkout 0.9.15 In x64 native tools prompt: make PythonAPI make launch

this made my carla not working.. ㅜㅡㅜ

But mine made it work :)

I'm a sinner I did it the way you told me, and I succeeded in working properly! For more information, run to Update.sh after git clone, then git fetch, git checkout, then make Python API, make launch!

Thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

jorge-kabuto commented 2 weeks ago

Hello folks, Thanks for your patience concerning this issue. Seems like this is a problem with the default installation of carla packages. The preferred method of carla python distribution is now to compile directly. I'd advise against doing the git checkout of 0.9.15, as this might leave you without some changes. I would recommend running "pip uninstall carla" from any terminal to ensure that any default installed packages are removed and then running "make PythonAPI" from the x64 native tools terminal.