Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

error with a model with some blanchs in input layer #282

Open
oscesteros opened this issue Mar 23, 2021 · 0 comments
Open

error with a model with some blanchs in input layer #282

oscesteros opened this issue Mar 23, 2021 · 0 comments

Comments

@oscesteros
Copy link

hello contributors:

I've tried to use Lucid with a customized model using the .save function. This model has an input layer that is split into three branches (red, green, and blue are processed in separated branches and concatenate at the end). I have used a lambda function and a reshape:

Input = tf.keras.Input(shape=(224,224,3))
batch=tf.shape(Input)
R= tf.keras.layers.Lambda(lambda x: x[:,:,:,0],)(Input)
R= tf.reshape( R, [batch[0], 224,224,1])

I have obtained this error which the .render_vis in reshape operation:

InvalidArgumentError: 2 root error(s) found.
(0) Invalid argument: Input to reshape is a tensor with 21025 values, but the requested shape has 50176
[[{{node import/Reshape}}]]
[[Mean/_29]]
(1) Invalid argument: Input to reshape is a tensor with 21025 values, but the requested shape has 50176
[[{{node import/Reshape}}]]
0 successful operations.
0 derived errors ignored.

the image has 224x224, and 50176 are values for a tensor with a channel (224x224=50176). 21025 is a 145x145 matrix.

thanks

Oscar

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

No branches or pull requests

1 participant