Closed ronakdedhia18 closed 6 years ago
Yup found the bug. I was changing axis for data format channels first, but was then dim shuffling the data prior to computing the coordinates. Should probably be fixed now.
So should I expect an updated coord.py file from you ? Or should I make changes in my code?
Yeah there's an updated coord.py file. Use that and see if it works. If it doesn't, post the stacktrace here.
Hi, I am using this below code x = Conv2D(32, (3, 3), padding='same', activation='relu')(x) x = Conv2D(32, (3, 3), padding='same', activation='relu')(x) x = Conv2D(64, (3, 3), padding='same', activation='relu')(x) x = Conv2D(64, (3, 3), padding='same', activation='relu')(x) x = Conv2D(3, (3, 3), padding='same', activation='linear')(x) x = Flatten()(x) x = Softmax()(x) I am getting some error. Also i want to add pooling layers and dense layer. My problem is a regression one. So I want to use model.add(Dense(8)) Please let me know. Attaching the error file. Error.txt
Hi, Can i write my model as below by passing x?
model = Sequential() ip=Input(shape=(3,128,128)) x = CoordinateChannel2D(data_format="channels_first")(ip)
model.add(Conv2D(32, (4,4), input_shape=(3,128,128),padding='same',data_format='channels_first'))(x) model.add(Activation('relu'))
model.add(Conv2D(32,(4,4),padding='same'))(x) model.add(Activation('relu')) model.add(MaxPooling2D(pool_size=(2,2)))(x) model.add(Dropout(0.25))
model.add(Conv2D(64, (4,4),padding='same'))(x) model.add(Activation('relu'))
model.add(Conv2D(64,(4,4),padding='same'))(x) model.add(Activation('relu')) model.add(MaxPooling2D(pool_size=(2,2))) model.add(Dropout(0.25))
model.add(Dense(1024)) model.add(Activation('relu')) model.add(Dropout(0.25))
model.add(Dense(8))
@titu1994 please let me know your views on this as well.
Thankyou.
Hi, ip=Input(shape=(3,128,128)) x = CoordinateChannel2D(data_format="channels_first")(ip) print(x) gives below output Tensor("coordinate_channel2d_1/transpose_3:0", shape=(?, 5, 128, 128), dtype=float32) The shape should be rather (?,3,128,128) Please let me know.
Thank you.
CoordinateChannel adds indices, so the 5 in place of 3 is correct. Are you getting any error?
Yes i have already posted a error.txt file after using below model Error.txt
x = Conv2D(32, (3, 3), padding='same', activation='relu')(x) x = Conv2D(32, (3, 3), padding='same', activation='relu')(x) x = Conv2D(64, (3, 3), padding='same', activation='relu')(x) x = Conv2D(64, (3, 3), padding='same', activation='relu')(x) x = Conv2D(3, (3, 3), padding='same', activation='linear')(x) x = Flatten()(x) x = Softmax()(x) I am getting some error. Also i want to add pooling layers and dense layer. My problem is a regression one. So I want to use model.add(Dense(8)) Please let me know. Attaching the error file.
Update your coord.py file and try it now.
Yes i will check. But can you tell me if the below model would work in this case. Hi, Can i write my model as below by passing x?
model = Sequential() ip=Input(shape=(3,128,128)) x = CoordinateChannel2D(data_format="channels_first")(ip)
model.add(Conv2D(32, (4,4), input_shape=(3,128,128),padding='same',data_format='channels_first'))(x) model.add(Activation('relu'))
model.add(Conv2D(32,(4,4),padding='same'))(x) model.add(Activation('relu')) model.add(MaxPooling2D(pool_size=(2,2)))(x) model.add(Dropout(0.25))
model.add(Conv2D(64, (4,4),padding='same'))(x) model.add(Activation('relu'))
model.add(Conv2D(64,(4,4),padding='same'))(x) model.add(Activation('relu')) model.add(MaxPooling2D(pool_size=(2,2))) model.add(Dropout(0.25))
model.add(Dense(1024)) model.add(Activation('relu')) model.add(Dropout(0.25))
model.add(Dense(8))
Hi, I am not getting any error now. But i cant use your model. when i use in mine its showing uncallable object is called. Can you please suggest a fix @titu1994
Error still persists ValueError Traceback (most recent call last)
This is not an issue with the script but with your model. Use he example model I've given to see the mistake. As far as I can see, you are mixing a Keras Model with Sequential, and this two don't work together like that. Sequential doesn't need an Input layer like Model, and instead wants the first layer to have the parameter input_shape defined there.
I don't use sequential models much, so I may be incorrect in that. Refer to the model I have in the experiments section.
Hi, I am getting this by appying your model @titu1994
ValueError Traceback (most recent call last)
Hi, I am using the following code ip=Input(shape=(3,128,128)) x = CoordinateChannel2D(data_format="channels_first")(ip) But i am getting some error. ValueError: Dimension 1 in both shapes must be equal, but are 3 and 1. Shapes are [128,3] and [?,1]. for 'coordinate_channel2d_5/concat' (op: 'ConcatV2') with input shapes: [?,128,128,3], [?,?,?,1], [?,?,?,1], [] and with computed input tensors: input[3] = <1>.
Shape of x_train is (892, 3, 128, 128) Shape of y_train is (892, 8) I have uploaded a text file of entire error which i am getting. Please let me know. Thankyou.
Error.txt