AutonomousDrivingCookbook icon indicating copy to clipboard operation
AutonomousDrivingCookbook copied to clipboard

ValueError: cannot reshape array of size 1 into shape (0,0,4)

Open higho51420 opened this issue 5 years ago • 1 comments

Your issue may already be reported! Please make sure to search all open and closed issues before starting a new one. I run the testmodel last cell.
ValueError: cannot reshape array of size 1 into shape (0,0,4)

Problem description

(Please provide a 2-3 sentence description of your problem. Be concise to ensure this description is useful for future users who might run into the same issue.)

Problem details

ValueError Traceback (most recent call last) in () 7 car_controls.throttle = 0.0 8 ----> 9 image_buf[0] = get_image() 10 state_buf[0] = np.array([car_controls.steering, car_controls.throttle, car_controls.brake, car_state.speed]) 11 model_output = model.predict([image_buf, state_buf])

in get_image() 2 image_response = client.simGetImages([ImageRequest(0, AirSimImageType.Scene, False, False)])[0] 3 image1d = np.fromstring(image_response.image_data_uint8, dtype=np.uint8) ----> 4 image_rgba = image1d.reshape(image_response.height, image_response.width, 4) 5 6 return image_rgba[76:135,0:255,0:3].astype(float)

ValueError: cannot reshape array of size 1 into shape (0,0,4)

Experiment/Environment details

keras 2.1.2 numpy 1.13.3 tensorflow 1.3 pandas 0.20.3

higho51420 avatar May 04 '20 14:05 higho51420

when does it happened? is it from the start or in the middle of running? have you tried to re-train the model?

idk if that will works for you but try this:

image_rgba = image1d.reshape(image_response.height, image_response.width, 4)

change to

image_rgba = image1d.reshape(image_response.height, image_response.width, 3)

kutilanak avatar May 13 '22 14:05 kutilanak