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

Call arguments received by layer 'model_18' (type Functional): • inputs=tf.Tensor(shape=(1, 384, 8), dtype=float32) • training=True • mask=None #561

Open
luizfysouza opened this issue Apr 18, 2023 · 0 comments

Comments

@luizfysouza
Copy link

luizfysouza commented Apr 18, 2023

I'm trying to segment MRI images with the following shape (x_img, y_image, n_slices).

The shape varies from image to image (in number of slices and image size).

I tried to use only 1 image to train just to test if the dimensions are correct, but it returns the following error:

Call arguments received by layer 'model_18' (type Functional): • inputs=tf.Tensor(shape=(1, 384, 8), dtype=float32) • training=True • mask=None

The code used was:

BACKBONE = 'resnet34'
preprocess_input = sm.get_preprocessing(BACKBONE)
model = sm.Unet('resnet34', encoder_weights=None, classes=3, activation='relu', input_shape=(None, None, 10))
model.compile('Adam', loss=sm.losses.bce_jaccard_loss, metrics=[sm.metrics.iou_score])

img = preprocess_input(img)

model.fit( x = img, y = img, batch_size=1, epochs=1, verbose=1)

*Note that i used input_shape (None, None, 8) because the image i tested has shape (276, 384, 8), but other images of the dataset have different number of channels and dimension, but I didn't see any way of using a dataset with images that have different number of channels.

This return the error in the title, is there a way to correct it?

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

1 participant