Skip to content
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

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

Open
higho51420 opened this issue May 4, 2020 · 1 comment
Open

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

higho51420 opened this issue May 4, 2020 · 1 comment

Comments

@higho51420
Copy link

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

@kutilanak
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants