Open jaroslawjanas opened 10 months ago
This is related to #254 and probably also #280. The code expects "tensor-like" input, not strings. Even if this isn't fixed, the error should definitely be caught earlier and stated more clearly. As it stands, process_input
doesn't know what to do with this kind of input, and there are related issues coming from traverse_input_data
.
I would love to work on this. Does anyone have opinions on what should be done: new functionality to handle text input, or a better error message?
Either solution sounds good to me. The better error message sounds like a good place to start, and then handling text input would be a good followup. PRs are definitely welcome!
Describe the bug I have a custom TextVectorization layer, it doesn't use any
nn.
layers, it's just a dictionary of words that is used to fill in atorch.zeros
vector. I want it to be baked in so I put it as the first layer in my model.Unfortunately, it doesn't work with
torchinfo.summary(mode, input_shape(["test"] * batch_size)
. Which is bothersome.The
model.forward(["this is a test"])
works just fine so I am somewhat confident that it's an issue with torchinfo not being able to handle my custom layer. It worked fine without it (with random int tokens as input data).Code and Setup TextVectorization
Model
Summary
Runtime Error
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):