Comments (2)
Hi,
Not sure if you're still encountering this issue. I tried checking out your dataset, but couldn't access it. Are there enough samples in data? Another option if working with small sample sizes is to decrease batch_size significantly in the fit method.
Hope this helps.
from autokeras.
- Problem: I get this error if the dataset has 41 or fewer rows. There is no error when the data set is 42 or higher!
- Fix: The Following change in batch_size fixes this problem: default is 32
search.fit(x=X_train, y=y_train, verbose=0, epochs=10, batch_size=12)
- Details: Autokeras 1.1, Code, and passing/failing data sets are attached.
code
url = 'auto-insurance_41a.csv'
dataframe = read_csv(url, header=None)
print(dataframe.shape)
split into input and output elements
data = dataframe.values
data = data.astype('float32')
X, y = data[:, :-1], data[:, -1]
print(X.shape, y.shape)
separate into train and test sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=1)
search = StructuredDataRegressor(max_trials=15, loss='mean_absolute_error')
search.fit(x=X_train, y=y_train, verbose=0, epochs=10)
code
error
Reloading Tuner from ./structured_data_regressor/tuner0.json
ValueError Traceback (most recent call last)
in <cell line: 11>()
9 search = StructuredDataRegressor(max_trials=15, loss='mean_absolute_error')
10 # perform the search
---> 11 search.fit(x=X_train, y=y_train, verbose=0, epochs=10)
12 # evaluate the model
13 mae, _ = search.evaluate(X_test, y_test, verbose=0)
2 frames
/usr/local/lib/python3.10/dist-packages/autokeras/tasks/structured_data.py in fit(self, x, y, epochs, callbacks, validation_split, validation_data, **kwargs)
137 self.check_in_fit(x)
138
--> 139 history = super().fit(
140 x=x,
141 y=y,
/usr/local/lib/python3.10/dist-packages/autokeras/auto_model.py in fit(self, x, y, batch_size, epochs, callbacks, validation_split, validation_data, verbose, **kwargs)
286 # Split the data with validation_split.
287 if validation_data is None and validation_split:
--> 288 dataset, validation_data = data_utils.split_dataset(
289 dataset, validation_split
290 )
/usr/local/lib/python3.10/dist-packages/autokeras/utils/data_utils.py in split_dataset(dataset, validation_split)
44 num_instances = dataset.reduce(np.int64(0), lambda x, _: x + 1).numpy()
45 if num_instances < 2:
---> 46 raise ValueError(
47 "The dataset should at least contain 2 batches to be split."
48 )
ValueError: The dataset should at least contain 2 batches to be split.
Error
auto-insurance_41a.csv
auto-insurance_42a.csv
from autokeras.
Related Issues (20)
- Can the models not be saved during the trial?
- problem: Higher number of epochs lead to worse results? HOT 1
- Bug: Error "I tensorflow/core/common_runtime/executor.cc:1197] [/device:CPU:0] (DEBUG INFO) Executor start aborting (this does not indicate an error and you can ignore this message): INVALID_ARGUMENT: You must feed a value for placeholder tensor 'Placeholder/_15' with dtype double and shape"
- Feature: Any GPU optimization features?
- Bug: KeyError: 'text_block_1/max_tokens' HOT 5
- Feature: Model Agnostic Explanability - Permutation Importance and Counterfactual
- Bug: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 205. in Chinese path, not in English path
- Bug: TypeError: can only concatenate str (not "NoneType") to st HOT 1
- Bug: Unable to predict data using the model trained (Node: 'model/multi_category_encoding/string_lookup_22/None_Lookup/LookupTableFindV2' Table not initialized. [[{{node model/multi_category_encoding/string_lookup_22/None_Lookup/LookupTableFindV2}}]] [Op:__inference_predict_function_10129638] )
- Bug: HOT 4
- AttributeError: module 'numpy' has no attribute 'object' when using autokeras with structured data HOT 5
- Autokers textinput text classifier does not work.
- ModuleNotFoundError: No module named 'tensorflow.keras.layers.experimental'Bug: HOT 4
- Bug: import autokeras as ak --> ModuleNotFoundError: No module named 'tensorflow.keras.layers.experimental' HOT 8
- Bug: FatalTypeError: Expected the model-building function, or HyperModel.build() to return a valid Keras Model instance
- Bug: StructuredDataClassifier and StructuredDataRegressor gone? HOT 6
- Bug: Autokeras/TF fails with CUDA_ERROR_ILLEGAL_ADDRESS/CUDA_ERROR_INVALID_HANDLE when max_trials is not 1
- Bug: "Best val_accuracy So Far" is mistaken for "Best val_loss So Far"
- Feature: 希望AutoKeras可以基于目前最新的Keras3,支持Keras3的新特性!
- Why was the TimeSeries parts of the package removed in the latest version?
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 autokeras.