Skip to content

DQNCar.py returns error on image reshaping #1840

Description

Airsim version: 1.2
Car environment: Unity
Python file: DQNcar.py

Whenever I try to run this code, I get this error:

Traceback (most recent call last):
  File "DQNcar.py", line 513, in <module>
    current_state = transform_input(responses)
  File "DQNcar.py", line 434, in transform_input
    img2d = np.reshape(img1d, (responses[0].height, responses[0].width))
  File "C:\Users\shovon\AppData\Local\conda\conda\envs\ml_agents\lib\site-packages\numpy\core\fromnumeric.py", line 257, in reshape
    return _wrapfunc(a, 'reshape', newshape, order=order)
  File "C:\Users\shovon\AppData\Local\conda\conda\envs\ml_agents\lib\site-packages\numpy\core\fromnumeric.py", line 52, in _wrapfunc
    return getattr(obj, method)(*args, **kwds)
ValueError: cannot reshape array of size 1 into shape (144,256)

I tried to manually print output of responses[0].image_data_float but I only get [0.]

Any solutions?
TIA.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions