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

Pandas FutureWarning #19

Open
marcm-ml opened this issue Aug 9, 2021 · 1 comment
Open

Pandas FutureWarning #19

marcm-ml opened this issue Aug 9, 2021 · 1 comment

Comments

@marcm-ml
Copy link

marcm-ml commented Aug 9, 2021

I get the following FutureWarning on torchsummary 1.3.0 (latest) and pandas 1.3.1 (latest) on Python 3.9 under Windows10

FutureWarning: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated; in a future version this will raise TypeError.  Select only valid columns before calling the reduction.
  df_sum = df.sum()
@helion-du-mas-des-bourboux-thales

For more info the line in question is there:
/usr/local/lib/python3.7/dist-packages/torchsummaryX/torchsummaryX.py:101:

psychAo added a commit to psychAo/torchsummaryX that referenced this issue Jan 19, 2022
Issue nmhkahn#19 reported a feature warning while using pandas package. The details can be found at (https://pandas.pydata.org/pandas-docs/stable/whatsnew/v1.3.0.html#deprecations).
To sum up, users need to select only valid columns before calling the reduction function (e.g. .min, .max, .sum) on a DataFrame.
So, in line 113 "df_sum = df.sum()" is replaced with "df_sum = df[["params_nt", "Mult-Adds", "Params", "Non-trainable params"]].sum()".
This columns are useful to show the final table of network's information.
Without redundant .sum() caculations on other columns, very very little time also can be saved : )
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

2 participants