-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
ValueError: Layer model_8 expects 1 input(s), but it received 2 input tensors #412
Comments
Can you show your |
I am using the multiclass segmentation example code that was provided as a basis. `class Dataloder(keras.utils.Sequence):
|
Were you able to figure it out? You error is just showing that you're providing two tensors as a list, which is coming from |
@JordanMakesMaps read it somewhere stating that in newer tensorflow or keras require the return batch as tuple rather than list
Above modification works for me |
where to do these modification? |
@jkViswanadham @WeiChihChern's modified function is for the |
I did this modification and it worked, however my desktop turned black screen at the second epoch! Do you have any ideas what i should change? Thank you very much |
Very frustrated by these nerdy retro-compatibility breaks... Not against you, guys, I only need to steam off. |
I have found the same casting hint as well; though it returns the error message like: @JordanMakesMaps any thoughts or former experiences what to be debugged? how do you take up debugging when this error message pops up? |
@NavidCOMSC I use a custom dataloader instead of the one provided here in the repo. I just checked my code and I do in fact return a tuple instead of a list. I guess I ran into that error a while back, made the change and completely forgot about it: ...
batch_x = np.array( processed_images )
batch_y = np.array( processed_masks )
del the_tile, the_mask, one_hot_mask, processed_image, processed_mask
return (batch_x, batch_y) |
@qubvel this should be integrated in the examples. |
Fixes qubvel#412 : Resizing Images to avoid errors Fixes Colab Bug : Using Segmentation Models
Getting an error when running model.fit in the multiple category training example.
history = model.fit( train_dataloader, steps_per_epoch=len(train_dataloader), epochs=EPOCHS, callbacks=callbacks, validation_data=valid_dataloader, validation_steps=len(valid_dataloader), )
Any ideas on what may be causing it? I suspect it has to do with my train_dataloader object, but I've prepared it as shown in the example.
ValueError: in user code:
The text was updated successfully, but these errors were encountered: