-
Notifications
You must be signed in to change notification settings - Fork 4.7k
There is something wrong with \AirSim\PythonClient\car\DQNcar.py #1710
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
Comments
I am also running into the same issue but with my own code. Also it happens pretty randomly.
|
I think its a bug in Airsim client.simGetImages API. The issue is the responses[0].height and responses[0].width returns 0. So the numpy reshape errors out once it encounters that. The workaround I have is to check for the condition where the responses[0].width and responses[0].height is "0" and once that condition occurs, I pass dummy image ( all 1's) and then reset airsim so it doesn't crash simulation. |
I will have a try, thanks |
@CaoYongshengcys did you resolve the issue? If so how did you resolved |
I did not solve this problem |
did anyone resolve this issue? |
Getting the same problem :( |
possibly related to #1009 |
Hi, thank you for reporting this issue. This script was recently removed in #3215 and replaced with a new script at \AirSim\PythonClient\reinforcement_learning\dqn_car.py that uses the new OpenAI gym wrapper. I tested the new script locally and it runs for me. Can you retest with the new script and report back if you see any issues? |
My error is as follows, anyone can help me ?
(base) D:\Unreal Projects\AirSim\PythonClient\car>python DQNcar.py
Connected!
Client Ver:1 (Min Req: 1), Server Ver:1 (Min Req: 1)
Selected CPU as the process wide default device.
Traceback (most recent call last):
File "DQNcar.py", line 536, in
current_state = transform_input(responses)
File "DQNcar.py", line 434, in transform_input
img2d = np.reshape(img1d, (responses[0].height, responses[0].width))
File "D:\Anaconda3\lib\site-packages\numpy\core\fromnumeric.py", line 257, in reshape
return _wrapfunc(a, 'reshape', newshape, order=order)
File "D:\Anaconda3\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 (0,0)
The text was updated successfully, but these errors were encountered: