我已經安裝了Tensorflow軟件包,並且已經從IBM s390x體系結構的源代碼中進行了編譯。如在教程中描述的圖像識別classify_image.py樣品引發錯誤如下所示:在s390x上使用Tensorflow進行圖像識別(教程示例)
運行命令:
python ./classify_image.py --model_dir=/data/shared/myprojects/tensorflow/models/models-master/tutorials/image/imagenet --image_file=/data/shared/myprojects/keras/images/claude_profile.jpg
錯誤消息:
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/common_shapes.py", line 659, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Cannot reshape a tensor with 1041082757314414592 elements to shape [16777216,524288] (8796093022208 elements) for 'pool_3/_reshape' (op: 'Reshape') with input shapes: [1,22546423,22546423,2048], [2] and with input tensors computed as partial shapes: input[1] = [16777216,524288].
版本:
python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.VERSION
'1.3.1'
>>>
可能的錯誤原因是排序的不兼容性,因爲訓練模型可能在CPU以大端模式工作時以小尾數表示法存儲。有沒有簡單的方法來配置一個字節交換來改變輸入數據的字節順序?其他Tensorflow樣本,沒有圖像處理例程執行OK。
初始模型是TensorFlow分佈的一部分。我根據這裏的指示完成了一個bazel構建[https://www.tensorflow.org/tutorials/image_retraining] 當加載二進制模型文件名classify_image_graph_def.pb時,再培訓步驟會導致完全相同的運行時錯誤: ValueError:無法使用1041082757314414592元素爲'pool_3/_reshape'(op:'Reshape')塑造[16777216,524288](8796093022208個元素)的張量,其中包含輸入形狀:[1,22546423,22546423,2048],[ 2],輸入張量計算爲部分形狀:input [1] = [16777216,524288]。 –
你可以在github上提交錯誤嗎? –
感謝您的支持。我在Github#2485下提交了一個錯誤。我們的社區支持團隊正在檢查問題。 –