我已经安装了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下提交了一个错误。我们的社区支持团队正在检查问题。 –