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

unsupported operand type(s) for +: 'int' and 'str' #268

Open
PANFEI-CHENG opened this issue Aug 30, 2023 · 2 comments
Open

unsupported operand type(s) for +: 'int' and 'str' #268

PANFEI-CHENG opened this issue Aug 30, 2023 · 2 comments

Comments

@PANFEI-CHENG
Copy link

when I use torchinfo with model taking dictionary as input
summary(self.model, input_data = [data_dict])
I meet a bug :
TypeError (note: full exception trace is shown but execution is paused at: _run_module_as_main)
unsupported operand type(s) for +: 'int' and 'str'
python3.8/site-packages/torchinfo/torchinfo.py", line 512, in
lambda data: (lambda d: sum(d.values()))

@snimu
Copy link
Contributor

snimu commented Sep 15, 2023

Could you please provide the whole exception trace? I cannot debug this with that little data. It would also help if you could share how your data_dict looks exactly, and preferably also how your model is structured.

@Gorluxor
Copy link

@PANFEI-CHENG my comment at #258 (comment) is exactly the same problem I had.

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

3 participants