Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roi pooling with vgg #22

Open
ZibaBahari opened this issue Apr 26, 2018 · 2 comments
Open

roi pooling with vgg #22

ZibaBahari opened this issue Apr 26, 2018 · 2 comments

Comments

@ZibaBahari
Copy link

Hi @yhenon!
Thanks for creating a repository on SPP methods!
I've used your code in the following model, but I encountered the following error. Please help me.
.
.
...
pooling_regions = [1, 2, 4]
num_rois = 2
num_channels = 3
in_img = Input(shape=(224,224, num_channels))
in_roi = Input(shape=(num_rois, 4))

model = Sequential([
ZeroPadding2D((1,1),input_shape=input_shape),
Conv2D(64, (3, 3),
activation='relu'),
ZeroPadding2D((1,1)),
Conv2D(64, (3, 3), activation='relu'),
MaxPooling2D(pool_size=(2, 2), strides=(2, 2)),
ZeroPadding2D((1,1)),
Conv2D(128, (3, 3), activation='relu'),
ZeroPadding2D((1,1)),
Conv2D(128, (3, 3), activation='relu'),
ZeroPadding2D((1,1)),
MaxPooling2D(pool_size=(2, 2), strides=(2, 2)),
ZeroPadding2D((1,1)),
Conv2D(256, (3, 3), activation='relu'),
ZeroPadding2D((1,1)),
Conv2D(256, (3, 3), activation='relu'),
ZeroPadding2D((1,1)),
Conv2D(256, (3, 3), activation='relu'),
MaxPooling2D(pool_size=(2, 2), strides=(2, 2)),
ZeroPadding2D((1,1)),
Conv2D(512, (3, 3), activation='relu'),
ZeroPadding2D((1,1)),
Conv2D(512, (3, 3), activation='relu'),
ZeroPadding2D((1,1)),
Conv2D(512, (3, 3), activation='relu'),
MaxPooling2D(pool_size=(2, 2), strides=(2, 2)),
ZeroPadding2D((1,1)),
Conv2D(512, (3, 3), activation='relu'),
ZeroPadding2D((1,1)),
Conv2D(512, (3, 3), activation='relu'),
ZeroPadding2D((1,1)),
Conv2D(512, (3, 3), activation='relu'),
Conv2DTranspose(128, (1, 1), activation='relu', padding='same',strides=(1, 1)),
Conv2DTranspose(256, (4, 4), activation='relu', padding='same', strides=(2, 2)),
Conv2DTranspose(256, (8, 8), activation='relu', padding='same', strides=(4, 4)),
RoiPooling(pooling_regions, num_rois)([in_img, in_roi]),
SpatialPyramidPooling([1,2,4]),
Dense(4096, activation='relu'),
Dropout(0.5),
Dense(4096, activation='relu'),
Dropout(0.5),
Dense(2, activation='softmax')
])
...
TypeError: The added layer must be an instance of class Layer. Found: Tensor("roi_pooling_1/Reshape_42:0", shape=(1, 2, 63), dtype=float32)

@ZibaBahari
Copy link
Author

Hi @yhenon!
I really need your help, please answer
my question.

@9527-ly
Copy link

9527-ly commented May 19, 2021

Excuse me.
I want to know if you have solved this question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants