yeephycho/nasnet-tensorflow

python image_inference.py

PythonImageDeveloper opened this issue · 2 comments

Hi , when i run the image_inference.py , i get this error , my # of classes=12 , i've trained nas-mobile on my own dataset. and my test images are multi-scale images.

python3 image_inference.py
Traceback (most recent call last):
  File "image_inference.py", line 108, in <module>
    sys.exit(main(sys.argv[1:]))
  File "image_inference.py", line 91, in main
    input_batch = input_concat.reshape(-1, 331, 331, 3)
ValueError: cannot reshape array of size 5 into shape (331,331,3)

Nasnet-mobile's input is 224x224, and I don't know why you got an "array of size 5", trace your bug and fix it.

my test images are multi-scale images. should be all images greater than 224 ? if so , in this code can't do this ?
i change your code : all 331 to 224 and 116 to 112
and i use reshaped_image = tf.reshape(normalized_image, [-1, 224, 224, 3]) in that code but i get this error :

InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 290163 values, but the requested shape requires a multiple of 150528
	 [[Node: Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](truediv, Reshape/shape)]]