2017-10-13 59 views
0

当我使用tensorflow与jupyter,我有错误满足:张量 '对象有没有属性 '形状'

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] 

误差

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' 

我tensorflow是0.12.I不要' t知道如何解决这个问题我的tensorflow版本有问题吗?

回答

2

张量对象在TensorFlow 0.12中没有shape属性。 (这是在TensorFlow 1.0加。)

你要调用的函数get_shape

I_t0.get_shape() 
相关问题