carla icon indicating copy to clipboard operation
carla copied to clipboard

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

Open ssingh17j opened this issue 1 year ago • 8 comments

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

ssingh17j avatar Aug 06 '24 12:08 ssingh17j

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

Nithin-Supani avatar Aug 06 '24 12:08 Nithin-Supani

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?

stavtant avatar Aug 07 '24 10:08 stavtant

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

ghost avatar Aug 07 '24 11:08 ghost

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?

Turuu1124 avatar Aug 14 '24 19:08 Turuu1124

**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 avatar Aug 21 '24 09:08 stavtant

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

stavtant avatar Aug 26 '24 09:08 stavtant

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.. ㅜㅡㅜ

leeilju avatar Aug 28 '24 07:08 leeilju

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 :)

stavtant avatar Aug 28 '24 07:08 stavtant

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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

leeilju avatar Aug 28 '24 16:08 leeilju

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.

jorge-kabuto avatar Aug 30 '24 10:08 jorge-kabuto

@jorge-kabuto Hi! I have built the carla ue4 editor on ubuntu 20.04. Instead of git cloning, i downloaded the ue4-dev branch from carla github repository and extracted it locally. Then i ran the command "Update.sh" But now, when i run any pythonAPI examples in the ue4 simulator, i get this value error of R,G,B. I tried to follow your git --fetch solution, But i do that, i get the error "fatal: not a git repository " I got the similar error while doing "make PythonAPI". I solved the error by mentioning the carla version in the line 878 of Setup.sh. Can you assist me with this? i have mentioned about my problem in details in #8589 issue

shahbazsiddique69 avatar Jan 19 '25 16:01 shahbazsiddique69