You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In the code '15_processing_sequences_using_rnns_and_cnns', at the section 'Multivariate Time Series', the one-hot boolean variables should be converted to 0 and 1; otherwise, it will cause an error.
'ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float).'
To Reproduce
Please copy the code that fails here, using code blocks like this:
df_mulvar = df[["bus", "rail"]] / 1e6 # use both bus & rail series as input
df_mulvar["next_day_type"] = df["day_type"].shift(-1) # we know tomorrow's type
df_mulvar = pd.get_dummies(df_mulvar) # one-hot encode the day type
And if you got an exception, please copy the full stacktrace here:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in inverse
ZeroDivisionError: division by zero
Expected behavior
We should add some lines of code to avoid of error.
df_mulvar = df[["bus", "rail"]] / 1e6 # use both bus & rail series as input
df_mulvar["next_day_type"] = df["day_type"].shift(-1) # we know tomorrow's type
df_mulvar = pd.get_dummies(df_mulvar) # one-hot encode the day type
# Explicitly convert the last three columns to integers
for col in df_mulvar.columns[-3:]:
df_mulvar[col] = df_mulvar[col].astype(int) # Convert each column to 0s and 1s
Screenshots
Versions (please complete the following information):
OS: Win 11
Python: 3.10.8
TensorFlow: 2.10.0
Scikit-Learn: [e.g., 0.24.1]
Other libraries that may be connected with the issue: [e.g., gym 0.18.0]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Thanks for helping us improve this project!
Before you create this issue
Please make sure you are using the latest updated code and libraries: see https://github.com/ageron/handson-ml3/blob/main/INSTALL.md#update-this-project-and-its-libraries
Also please make sure to read the FAQ (https://github.com/ageron/handson-ml3#faq) and search for existing issues (both open and closed), as your question may already have been answered: https://github.com/ageron/handson-ml3/issues
Describe the bug
In the code '15_processing_sequences_using_rnns_and_cnns', at the section 'Multivariate Time Series', the one-hot boolean variables should be converted to 0 and 1; otherwise, it will cause an error.
'ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float).'
To Reproduce
Please copy the code that fails here, using code blocks like this:
And if you got an exception, please copy the full stacktrace here:
Expected behavior
We should add some lines of code to avoid of error.
Screenshots
Versions (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: