We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I ran the sample code and got an error when I got to the error.
Code:
library(magrittr) x_data <- matrix(data = runif(500,0,1),nrow = 50,ncol = 10) y_data <- ifelse(runif(50,0,1) > 0.6, 1L,0L) %>% as.matrix() x_data2 <- matrix(data = runif(500,0,1),nrow = 50,ncol = 10) y_data2 <- ifelse(runif(50,0,1) > 0.6, 1L,0L) %>% as.matrix() library(keras) library(tensorflow) library(kerastuneR) build_model = function(hp) { model = keras_model_sequential() model %>% layer_dense(units = hp$Int('units', min_value = 32, max_value = 512, step= 32),input_shape = ncol(x_data), activation = 'relu') %>% layer_dense(units = 1, activation = 'softmax') %>% compile( optimizer = tf$keras$optimizers$Adam( hp$Choice('learning_rate', values=c(1e-2, 1e-3, 1e-4))), loss = 'binary_crossentropy', metrics = 'accuracy') return(model) } tuner = RandomSearch( build_model, objective = 'val_accuracy', max_trials = 5, executions_per_trial = 3, directory = 'my_dir', project_name = 'helloworld') tuner %>% search_summary() tuner %>% fit_tuner(x_data,y_data, epochs = 5, validation_data = list(x_data2,y_data2)) When running the fit_tuner function, the following error occurs:Traceback (most recent call last): File "C:\Users\WANGSE~1\DOCUME~1\VIRTUA~1\R-TENS~1\lib\site-packages\keras_tuner\engine\base_tuner.py", line 270, in _try_run_and_update_trial self._run_and_update_trial(trial, *fit_args, **fit_kwargs) File "C:\Users\WANGSE~1\DOCUME~1\VIRTUA~1\R-TENS~1\lib\site-packages\keras_tuner\engine\base_tuner.py", line 235, in _run_and_update_trial results = self.run_trial(trial, *fit_args, **fit_kwargs) File "C:\Users\WANGSE~1\DOCUME~1\VIRTUA~1\R-TENS~1\lib\site-packages\keras_tuner\engine\tuner.py", line 279, in run_trial for execution in range(self.executions_per_trial): TypeError: 'float' object cannot be interpreted as an integer Error in py_call_impl(callable, call_args$unnamed, call_args$named) : RuntimeError: Number of consecutive failures excceeded the limit of 3. Traceback (most recent call last): File "C:\Users\WANGSE~1\DOCUME~1\VIRTUA~1\R-TENS~1\lib\site-packages\keras_tuner\engine\base_tuner.py", line 270, in _try_run_and_update_trial self._run_and_update_trial(trial, *fit_args, **fit_kwargs) File "C:\Users\WANGSE~1\DOCUME~1\VIRTUA~1\R-TENS~1\lib\site-packages\keras_tuner\engine\base_tuner.py", line 235, in _run_and_update_trial results = self.run_trial(trial, *fit_args, **fit_kwargs) File "C:\Users\WANGSE~1\DOCUME~1\VIRTUA~1\R-TENS~1\lib\site-packages\keras_tuner\engine\tuner.py", line 279, in run_trial for execution in range(self.executions_per_trial): TypeError: 'float' object cannot be interpreted as an integer
There seems to be an error in the data type, but I'm not familiar with python and would appreciate your help.
The text was updated successfully, but these errors were encountered:
turgut090
Successfully merging a pull request may close this issue.
Hello, I ran the sample code and got an error when I got to the error.
Code:
There seems to be an error in the data type, but I'm not familiar with python and would appreciate your help.
The text was updated successfully, but these errors were encountered: