Comments (6)
I'm experiencing the same error when I make the call to model.save()
from decision-forests.
Hey @sibyjackgrove
I'm experiencing the same error when I make the call to model.save()
I found this related issue: tensorflow/tensorflow#44984
After looking at my input data (train and test) I found that one of the columns was missing a header name. It was a column with an observation ID that uniquely identified each item in my input data.
After updating my CSV files by adding the column header 'id' (no quotes in file) to those two columns, the decision-forests library worked correctly.
I recommend you double check your input data and ensure:
all of the columns have a name in the header
none of the header names have a space or tab embedded in them.
from decision-forests.
@googlebot I recommend you update the exception handling in decision-forests to have a more intuitive error message to the engineer who experiences this issue in the future.
from decision-forests.
@abeusher Thanks for the tip. I removed the column names with spaces and tried again. But I am getting the same error.
So I removed other special characters like .,, and % from the column names. Now it is saving.
from decision-forests.
Thanks both for the report and the debugging! :)
It seems the default signature created by the keras model serialization does not support all characters.
Starting with the 0.1.6, TF-DF will raise an explicit error message if the feature contains one of those characters. The error can be turned into a warning for users who write custom export signatures. I'll also look into an alternative solution that does not forbid any character in the feature name.
New error message
train_df = pd.DataFrame({"label":[0,1,0,1],"f 1":[0,1,0,1]})
model = tfdf.keras.RandomForestModel()
model.fit(tfdf.keras.pd_dataframe_to_tf_dataset(train_df, label="label"))
ValueError: One or more feature names are not compatible with the Keras API: The feature name "f 1" contains a space or a tab character. This problem can be solved in one of two ways: (1; Recommended) Update the feature name(s) to be compatible. (2) Disable this error message (
fail_on_non_keras_compatible_feature_name=False
) and only use part of the compatible Keras API.
from decision-forests.
Thanks for the update. I was able to make model.save
work by removing spaces as well as characters like '%', and '.' in the column names.
from decision-forests.
Related Issues (20)
- max_vocab_count won't work for CATEGORICAL integerized in tfdf.keras.GradientBoostedTreesModel HOT 5
- Save and load model with tunning in automatic_tuning_colab.ipynb HOT 4
- Symbol not found, but versions are compatible according to the website HOT 4
- Loading a model returns either an untrained model or broken model HOT 1
- Using call_get_leaves inside @tf.function call in ensemble model inherits from tensorflow.keras.Model HOT 10
- no wheels for apple silicon (macos-arm64) HOT 2
- ANE support through coremltools HOT 4
- Can't use both `sample_weight` and `class_weight` at the same time HOT 1
- Is there a method like ydf.load_model() to load model get a instance of tfdf.keras.RandomForestModel? HOT 2
- decision forests tutorial tf_df_in_tf_js code wasn't working for me
- gpu support for layer use HOT 1
- DistributedGradientBoostedTreesModel does not support Ranking task HOT 1
- TF-DF Compatibility with Keras 3? HOT 6
- make_inspector() throws object of type 'NoneType' has no len() when I retrieve TF DF RF model layer in the hybrid model HOT 3
- tfdf 1.9.0 only compatible with tf 2.16.1 which ships Keras 3 HOT 8
- tensorflow-decision-forests 1.5.0 requires tensorflow~=2.13.0, but you have tensorflow 2.16.1 which is incompatible.
- Decision forest documentation link is broken in the Main page HOT 2
- WARNING:root:Failure to load the inference.so custom c++ tensorflow ops HOT 8
- OOM errors for large datasets
- Error while convering tensor flow decision forests td model into TFlite model HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from decision-forests.