You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
Some days ago I try to use mnist data set make a single image to predict, under the help of @clcarwin , who give me some useful advise. Now I try to use the model to train my own data, some gray scale images just like mnist. The shape is 256*256, 3 classes. When I use mlp I changed datashape as (65536,),
I got this message: mxnet.base.MXNetError: Invalid Parameter format for data_shape expect Shape(tuple) but value='65536'
When I use lenet, datashape as (1,256,256), it worked.
But I use the code to make simple image predict , it also crashed.
This is my predict code :
data = cv2.imread(dir_image) # check if the size of image is 256*256
data = data.transpose((2,0,1))
data = data[0:1,:,:]
print data.shape # (1,256, 256)
data = np.reshape(data,(1,1,256,256)) # for lenet (batchsize, ch, height, width)
data = np.reshape(data,(1,784)) # for mlp
model = mx.model.FeedForward.load(prefix, iteration)
dataiter = mx.io.NDArrayIter(data)
r = model.predict(dataiter)
and this is the error message:
mxnet.base.MXNetError: [11:36:00] src/ndarray/ndarray.cc:227: Check failed: from.shape() == to->shape() operands shape mismatch
If someone could give me some advise I will be very thankful, I have been puzzled by these problems some days.....
The text was updated successfully, but these errors were encountered:
Some days ago I try to use mnist data set make a single image to predict, under the help of @clcarwin , who give me some useful advise. Now I try to use the model to train my own data, some gray scale images just like mnist. The shape is 256*256, 3 classes. When I use mlp I changed datashape as (65536,),
I got this message: mxnet.base.MXNetError: Invalid Parameter format for data_shape expect Shape(tuple) but value='65536'
When I use lenet, datashape as (1,256,256), it worked.
But I use the code to make simple image predict , it also crashed.
This is my predict code :
data = cv2.imread(dir_image) # check if the size of image is 256*256
data = data.transpose((2,0,1))
data = data[0:1,:,:]
print data.shape # (1,256, 256)
data = np.reshape(data,(1,1,256,256)) # for lenet (batchsize, ch, height, width)
data = np.reshape(data,(1,784)) # for mlp
model = mx.model.FeedForward.load(prefix, iteration)
dataiter = mx.io.NDArrayIter(data)
r = model.predict(dataiter)
and this is the error message:
mxnet.base.MXNetError: [11:36:00] src/ndarray/ndarray.cc:227: Check failed: from.shape() == to->shape() operands shape mismatch
If someone could give me some advise I will be very thankful, I have been puzzled by these problems some days.....
The text was updated successfully, but these errors were encountered: