0

when I using tensorflow with jupyter,I meet with a error:

img_h,img_w,img_c=128,384,3
I_t0,I_t1,learning_rate,steering=model_input(img_h,img_w,img_c)
assert I_t0.shape.as_list()==[None,128,384,3]
assert I_t1.shape.as_list()==[None,128,384,3]
assert steering.shape.as_list()==[None,1]

the error is

AttributeError                            Traceback (most recent call last)
<ipython-input-11-36e96cd24088> in <module>()
      1 img_h,img_w,img_c=128,384,3
      2 I_t0,I_t1,learning_rate,steering=model_input(img_h,img_w,img_c)
----> 3 assert I_t0.shape.as_list()==[None,128,384,3]
      4 assert I_t1.shape.as_list()==[None,128,384,3]
      5 assert steering.shape.as_list()==[None,1]

AttributeError: 'Tensor' object has no attribute 'shape'

my tensorflow is 0.12.I don't know how to fix it Any wrong with my version of tensorflow?

1 Answer 1

2

The tensor objects do not have a shape attribute in TensorFlow 0.12. (It was added in TensorFlow 1.0.)

You have to call the get_shape function:

I_t0.get_shape()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.